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")
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)