Build configuration cleaned up 76/198976/1 accepted/tizen/unified/20190131.161540 submit/tizen/20190131.112412
authorsaerome.kim <saerome.kim@samsung.com>
Thu, 31 Jan 2019 10:48:03 +0000 (19:48 +0900)
committersaerome.kim <saerome.kim@samsung.com>
Thu, 31 Jan 2019 10:48:03 +0000 (19:48 +0900)
Change-Id: I7de6a5281ec6ef7dc03be1fc01d03f0a1202a908
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
CMakeLists.txt

index 25c5925..1cd5e3a 100644 (file)
@@ -23,14 +23,11 @@ pkg_check_modules(${CAPI_MDG} REQUIRED ${COMMON_DEPS})
 FOREACH(flag ${${CAPI_MDG}_CFLAGS})
     SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
 ENDFOREACH(flag)
-
+SET(DEFAULT_CFLAGS "${EXTRA_CFLAGS} -Wall -fPIE -fPIC -Werror -g -fvisibility=hidden")
 IF(BUILD_GCOV)
-       SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -Werror -g -fvisibility=hidden -fprofile-arcs -ftest-coverage")
-ELSE(BUILD_GCOV)
-       SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -Werror -g -fvisibility=hidden")
+       SET(GCOV_C_FLAGS "-fprofile-arcs -ftest-coverage")
 ENDIF(BUILD_GCOV)
-
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -Werror -g -fvisibility=hidden")
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${DEFAULT_CFLAGS} ${GCOV_C_FLAGS}")
 SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
 
 IF("${ARCH}" STREQUAL "arm")
@@ -40,7 +37,7 @@ ENDIF("${ARCH}" STREQUAL "arm")
 ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
 ADD_DEFINITIONS("-DTIZEN_DEBUG")
 
-SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=${LIBDIR}")
+SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -pie -Wl,--rpath=${LIBDIR}")
 
 MESSAGE(" - Generating...d-bus code")
 FIND_PROGRAM(GDBUS_CODEGEN NAMES gdbus-codegen)