Build fixes, changes: 35/27535/4
authorMaciej J. Karpiuk <m.karpiuk2@samsung.com>
Mon, 15 Sep 2014 13:47:13 +0000 (15:47 +0200)
committerMaciej J. Karpiuk <m.karpiuk2@samsung.com>
Tue, 16 Sep 2014 12:03:30 +0000 (14:03 +0200)
* added pthread dependency;
* _FORTIFY_SOURCE disabled when in DEBUG mode;

Change-Id: Ibcc94a0aec92bbc4714566948b02377b105a0eb0

CMakeLists.txt
src/CMakeLists.txt

index 4a7090c..639386b 100644 (file)
@@ -28,10 +28,10 @@ INCLUDE(FindPkgConfig)
 
 ############################# compiler flags ##################################
 
-SET(CMAKE_C_FLAGS_PROFILING    "-g -O0 -pg")
-SET(CMAKE_CXX_FLAGS_PROFILING  "-g -std=c++0x -O0 -pg")
-SET(CMAKE_C_FLAGS_DEBUG        "-g -O0 -ggdb")
-SET(CMAKE_CXX_FLAGS_DEBUG      "-g -std=c++0x -O0 -ggdb")
+SET(CMAKE_C_FLAGS_PROFILING    "-g -O0 -pg -Wp,-U_FORTIFY_SOURCE")
+SET(CMAKE_CXX_FLAGS_PROFILING  "-g -std=c++0x -O0 -pg -Wp,-U_FORTIFY_SOURCE")
+SET(CMAKE_C_FLAGS_DEBUG        "-g -O0 -ggdb -Wp,-U_FORTIFY_SOURCE")
+SET(CMAKE_CXX_FLAGS_DEBUG      "-g -std=c++0x -O0 -ggdb -Wp,-U_FORTIFY_SOURCE")
 SET(CMAKE_C_FLAGS_RELEASE      "-g -O2")
 SET(CMAKE_CXX_FLAGS_RELEASE    "-g -std=c++0x -O2")
 SET(CMAKE_C_FLAGS_CCOV         "-g -O2 --coverage")
index 80d484e..bb2d60a 100644 (file)
@@ -8,6 +8,7 @@ PKG_CHECK_MODULES(KEY_MANAGER_DEP
     db-util
     REQUIRED
     )
+FIND_PACKAGE(Threads REQUIRED)
 
 SET(KEY_MANAGER_SRC_PATH ${PROJECT_SOURCE_DIR}/src)
 SET(KEY_MANAGER_PATH ${PROJECT_SOURCE_DIR}/src/manager)
@@ -52,6 +53,7 @@ INCLUDE_DIRECTORIES(
 ADD_EXECUTABLE(${TARGET_KEY_MANAGER} ${KEY_MANAGER_SOURCES})
 
 TARGET_LINK_LIBRARIES(${TARGET_KEY_MANAGER}
+    ${CMAKE_THREAD_LIBS_INIT}
     ${KEY_MANAGER_DEP_LIBRARIES}
     ${TARGET_KEY_MANAGER_COMMON}
     )