# HG changeset patch
# User koda
# Date 1370650598 -7200
# Node ID 480f483de5446f0cbc050a6c7e398559bb49764d
# Parent  a43406054648a551654a67bc27135d59bdab216b
add fstack-protector and fvisibility=hidden to cmake tests

diff -r a43406054648 -r 480f483de544 cmake_modules/compilerchecks.cmake
--- a/cmake_modules/compilerchecks.cmake	Sat Jun 08 02:03:02 2013 +0200
+++ b/cmake_modules/compilerchecks.cmake	Sat Jun 08 02:16:38 2013 +0200
@@ -4,6 +4,19 @@
 #when you need to check for a linker flag, just leave the argument of "check_c_compiler_flag" empty
 
 
+#stack protection
+check_c_compiler_flag("-fstack-protector" HAVE_STACKPROTECTOR)
+if(HAVE_STACKPROTECTOR)
+    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstack-protector")
+endif()
+
+#symbol visibility
+check_c_compiler_flag("-fvisibility=hidden" HAVE_VISIBILITYH)
+if(HAVE_VISIBILITYH)
+    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden")
+endif()
+
+
 #check for noexecstack on ELF, Gentoo security
 set(CMAKE_REQUIRED_FLAGS "-Wl,-z,noexecstack")
 check_c_compiler_flag("" HAVE_NOEXECSTACK)