From 84a5361d7963523171d3da628471e26187ebb9d0 Mon Sep 17 00:00:00 2001 From: Ilho Kim Date: Fri, 17 Jun 2022 13:57:59 +0900 Subject: [PATCH] Fix variable that prevent unittest build Change-Id: I5308e5233ff0421a8721cdd63a63ce17ac40617d Signed-off-by: Ilho Kim --- CMakeLists.txt | 8 ++++---- packaging/pkgmgr-info.spec | 12 +++++++----- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f3df693..a7b24f6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -83,19 +83,19 @@ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}") SET(EXTRA_LINKER_FLAGS "-Wl,--as-needed") SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${EXTRA_LINKER_FLAGS}") -IF(ASAN_ENABLED) +IF(NOT ASAN_ENABLED) ENABLE_TESTING() SET(TARGET_PKGMGR_INFO_UNIT_TEST "pkgmgr-info-unit-test") -ENDIF(ASAN_ENABLED) +ENDIF(NOT ASAN_ENABLED) ################## ## build comm libraries ADD_SUBDIRECTORY(parser) ADD_SUBDIRECTORY(tool) ADD_SUBDIRECTORY(plugin_list) ADD_SUBDIRECTORY(src) -IF(ASAN_ENABLED) +IF(NOT ASAN_ENABLED) ADD_SUBDIRECTORY(test) -ENDIF(ASAN_ENABLED) +ENDIF(NOT ASAN_ENABLED) CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/pkgmgr-info.pc.in ${CMAKE_BINARY_DIR}/pkgmgr-info.pc @ONLY) CONFIGURE_FILE(pkg_db_version.txt.in pkg_db_version.txt @ONLY) diff --git a/packaging/pkgmgr-info.spec b/packaging/pkgmgr-info.spec index dac94f1..9125b5b 100755 --- a/packaging/pkgmgr-info.spec +++ b/packaging/pkgmgr-info.spec @@ -72,7 +72,7 @@ Requires: %{name}-common = %{version}-%{release} %description common-devel Dev package for libpkgmgr_common -%if 0%{?asan_enabled} +%if 0%{?asan} != 1 %package unittests Summary: %{name} unittests binary @@ -94,8 +94,10 @@ export LDFLAGS+=" -lgcov" MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'` %cmake . -DFULLVER=%{version} -DMAJORVER=${MAJORVER} -DUNITDIR=%{_unitdir} \ -%if 0%{?asan_enabled} - -DASAN_ENABLED=TRUE \ +%if 0%{?asan} != 1 + -DASAN_ENABLED=FALSE +%else + -DASAN_ENABLED=TRUE %endif %__make %{?jobs:-j%jobs} @@ -118,7 +120,7 @@ mkdir -p "$gcno_obj_dir" find . -name '*.gcno' -exec cp --parents '{}' "$gcno_obj_dir" ';' %endif -%if 0%{?asan_enabled} +%if 0%{?asan} != 1 cat << EOF > run-unittest.sh #!/bin/sh @@ -233,7 +235,7 @@ Packager Manager information api gcov objects %{_datadir}/gcov/obj/* %endif -%if 0%{?asan_enabled} +%if 0%{?asan} != 1 %files unittests %{_bindir}/pkgmgr-info-unit-test %{_bindir}/tizen-unittests/%{name}/run-unittest.sh -- 2.7.4