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 |
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 |
13 #it is disabled on win32 because it adds a dll and messes with linker |
|
14 #some bsd installations reported problems too |
14 #(see 822312 654424 on bugzilla.redhat.com) |
15 #(see 822312 654424 on bugzilla.redhat.com) |
15 check_c_compiler_flag("-fstack-protector-all -fstack-protector" HAVE_STACKPROTECTOR) |
16 check_c_compiler_flag("-fstack-protector-all -fstack-protector" HAVE_STACKPROTECTOR) |
16 if(HAVE_STACKPROTECTOR AND (NOT WIN32)) |
17 if(HAVE_STACKPROTECTOR AND ((NOT WIN32) OR (CMAKE_SYSTEM_NAME MATCHES BSD.OS))) |
17 add_flag_append(CMAKE_C_FLAGS "-fstack-protector-all -fstack-protector") |
18 add_flag_append(CMAKE_C_FLAGS "-fstack-protector-all -fstack-protector") |
18 add_flag_append(CMAKE_CXX_FLAGS "-fstack-protector-all -fstack-protector") |
19 add_flag_append(CMAKE_CXX_FLAGS "-fstack-protector-all -fstack-protector") |
19 add_flag_append(CMAKE_EXE_LINKER_FLAGS "-fstack-protector-all -fstack-protector") |
20 add_flag_append(CMAKE_EXE_LINKER_FLAGS "-fstack-protector-all -fstack-protector") |
20 add_flag_append(CMAKE_SHARED_LIBRARY_C_FLAGS "-fstack-protector-all -fstack-protector") |
21 add_flag_append(CMAKE_SHARED_LIBRARY_C_FLAGS "-fstack-protector-all -fstack-protector") |
21 add_flag_append(CMAKE_SHARED_LIBRARY_CXX_FLAGS "-fstack-protector-all -fstack-protector") |
22 add_flag_append(CMAKE_SHARED_LIBRARY_CXX_FLAGS "-fstack-protector-all -fstack-protector") |