Mercurial > trustbridge
comparison CMakeLists.txt @ 75:ec0f4efefb7b
Add profiling options for all C/CXX code if requested
author | Andre Heinecke <aheinecke@intevation.de> |
---|---|
date | Wed, 19 Mar 2014 15:36:35 +0000 |
parents | 7ed285380301 |
children | 2a031ac963b0 |
comparison
equal
deleted
inserted
replaced
74:7ed285380301 | 75:ec0f4efefb7b |
---|---|
44 if(ENABLE_PROFILING) | 44 if(ENABLE_PROFILING) |
45 set(PROFILING_FLAGS "-fprofile-arcs -ftest-coverage") | 45 set(PROFILING_FLAGS "-fprofile-arcs -ftest-coverage") |
46 set(PROFILING_LIBS gcov) | 46 set(PROFILING_LIBS gcov) |
47 endif() | 47 endif() |
48 | 48 |
49 SET(CMAKE_EXE_LINKER_FLAGS=${PROFILING_FLAGS}) | |
50 | |
51 if(UNIX) | 49 if(UNIX) |
52 set(HARDENING_FLAGS " ${HARDENING_FLAGS} -pie -fPIE -ftrapv") | 50 set(HARDENING_FLAGS " ${HARDENING_FLAGS} -pie -fPIE -ftrapv") |
53 set(HARDENING_FLAGS " ${HARDENING_FLAGS} -Wl,-z,relro,-z,now") | 51 set(HARDENING_FLAGS " ${HARDENING_FLAGS} -Wl,-z,relro,-z,now") |
54 elseif(WIN32) | 52 elseif(WIN32) |
55 set(HARDENING_FLAGS " ${HARDENING_FLAGS} -Wl,--dynamicbase -Wl,--nxcompat") | 53 set(HARDENING_FLAGS " ${HARDENING_FLAGS} -Wl,--dynamicbase -Wl,--nxcompat") |
56 endif() | 54 endif() |
57 | 55 |
58 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${HARDENING_FLAGS}") | 56 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${HARDENING_FLAGS} ${PROFILING_FLAGS}") |
59 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARN_HARDENING_FLAGS} ${HARDENING_FLAGS}") | 57 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARN_HARDENING_FLAGS} ${HARDENING_FLAGS} ${PROFILING_FLAGS}") |
60 | 58 |
61 add_custom_target(static_check) | 59 add_custom_target(static_check) |
62 | 60 |
63 # FlawFinder | 61 # FlawFinder |
64 find_program(FLAWFINDER_PATH flawfinder DOC "flawfinder path") | 62 find_program(FLAWFINDER_PATH flawfinder DOC "flawfinder path") |