Add PIE compile option 73/212773/1 accepted/tizen/unified/20190904.011511 submit/tizen/20190828.005444 submit/tizen/20190903.051547
authorDaehyeon Jung <darrenh.jung@samsung.com>
Mon, 26 Aug 2019 23:44:38 +0000 (08:44 +0900)
committerDaehyeon Jung <darrenh.jung@samsung.com>
Mon, 26 Aug 2019 23:44:38 +0000 (08:44 +0900)
Change-Id: I5785a2348e731fea5b070395d135c48bbb841bc8

tools/CMakeLists.txt

index 6517088..a9a6513 100644 (file)
@@ -3,6 +3,8 @@ SET(CAPMGR_TEST "capmgr-test")
 AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR} TOOLS_SRCS)
 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../)
 
+SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIE")
+
 ADD_EXECUTABLE(${CAPMGR_TEST} ${TOOLS_SRCS})
 
 APPLY_PKG_CONFIG(${CAPMGR_TEST} PUBLIC
@@ -11,6 +13,6 @@ APPLY_PKG_CONFIG(${CAPMGR_TEST} PUBLIC
   Boost
 )
 
-TARGET_LINK_LIBRARIES(${CAPMGR_TEST} PUBLIC ${TARGET_LIB_CAPMGR})
+TARGET_LINK_LIBRARIES(${CAPMGR_TEST} PUBLIC ${TARGET_LIB_CAPMGR} "-pie")
 
 INSTALL(TARGETS ${CAPMGR_TEST} DESTINATION bin)