7 # CMAKE_EXE_LINKER_FLAGS is for linker flags (also add them to pascal_flags and haskell_flags) |
7 # CMAKE_EXE_LINKER_FLAGS is for linker flags (also add them to pascal_flags and haskell_flags) |
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 |
|
13 #it is disabled on win32 because it adds a dll and messes with linker |
|
14 #(see 822312 654424 on bugzilla.redhat.com) |
13 check_c_compiler_flag("-fstack-protector-all -fstack-protector" HAVE_STACKPROTECTOR) |
15 check_c_compiler_flag("-fstack-protector-all -fstack-protector" HAVE_STACKPROTECTOR) |
14 if(HAVE_STACKPROTECTOR) |
16 if(HAVE_STACKPROTECTOR AND (NOT WIN32)) |
15 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstack-protector-all -fstack-protector") |
17 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstack-protector-all -fstack-protector") |
16 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstack-protector-all -fstack-protector") |
18 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstack-protector-all -fstack-protector") |
17 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fstack-protector-all -fstack-protector") |
19 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-all -fstack-protector") |
20 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_CXX_FLAGS} -fstack-protector-all -fstack-protector") |
21 set(CMAKE_SHARED_LIBRARY_CXX_FLAGS "${CMAKE_SHARED_LIBRARY_CXX_FLAGS} -fstack-protector-all -fstack-protector") |