equal
deleted
inserted
replaced
8 # CMAKE_SHARED_LIBRARY_<lang>_FLAGS same but for shared libraries |
8 # CMAKE_SHARED_LIBRARY_<lang>_FLAGS same but for shared libraries |
9 |
9 |
10 #TODO: should there be two different checks for C and CXX? |
10 #TODO: should there be two different checks for C and CXX? |
11 |
11 |
12 #stack protection, when found it needs to go in the linker flags too (-lssp is added) |
12 #stack protection, when found it needs to go in the linker flags too (-lssp is added) |
13 check_c_compiler_flag("-fstack-protector" HAVE_STACKPROTECTOR) |
13 check_c_compiler_flag("-fstack-protector-all -fstack-protector" HAVE_STACKPROTECTOR) |
14 if(HAVE_STACKPROTECTOR) |
14 if(HAVE_STACKPROTECTOR) |
15 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstack-protector") |
15 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstack-protector-all -fstack-protector") |
16 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstack-protector") |
16 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstack-protector-all -fstack-protector") |
17 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fstack-protector") |
17 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fstack-protector-all -fstack-protector") |
18 set(CMAKE_SHARED_LIBRARY_C_FLAGS "${CMAKE_SHARED_LIBRARY_C_FLAGS} -fstack-protector") |
18 set(CMAKE_SHARED_LIBRARY_C_FLAGS "${CMAKE_SHARED_LIBRARY_C_FLAGS} -fstack-protector-all -fstack-protector") |
19 set(CMAKE_SHARED_LIBRARY_CXX_FLAGS "${CMAKE_SHARED_LIBRARY_C_FLAGS} -fstack-protector") |
19 set(CMAKE_SHARED_LIBRARY_CXX_FLAGS "${CMAKE_SHARED_LIBRARY_C_FLAGS} -fstack-protector-all -fstack-protector") |
20 endif() |
20 endif() |
21 |
21 |
22 #symbol visibility |
22 #symbol visibility |
23 check_c_compiler_flag("-fvisibility=hidden" HAVE_VISIBILITYH) |
23 check_c_compiler_flag("-fvisibility=hidden" HAVE_VISIBILITYH) |
24 if(HAVE_VISIBILITYH) |
24 if(HAVE_VISIBILITYH) |