aboutsummaryrefslogtreecommitdiff
path: root/ConfigureChecks.cmake
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2012-10-14 18:39:30 +0200
committerAndreas Schneider <asn@cryptomilk.org>2012-10-14 18:40:05 +0200
commit7e93edc722e856f4ac4f273bf4a0fe220d29e76e (patch)
tree259dfb0890bead3217fd614c0c4cd1698a367647 /ConfigureChecks.cmake
parent95ab34696bbf3948a6c478f18b3e72c71539cd2e (diff)
downloadlibssh-7e93edc722e856f4ac4f273bf4a0fe220d29e76e.tar.gz
libssh-7e93edc722e856f4ac4f273bf4a0fe220d29e76e.tar.xz
libssh-7e93edc722e856f4ac4f273bf4a0fe220d29e76e.zip
cmake: Add better check to detect -fvisibility=hidden.
Diffstat (limited to 'ConfigureChecks.cmake')
-rw-r--r--ConfigureChecks.cmake7
1 files changed, 6 insertions, 1 deletions
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
index 988a3f62..19eb6002 100644
--- a/ConfigureChecks.cmake
+++ b/ConfigureChecks.cmake
@@ -36,7 +36,12 @@ endfunction()
if(CMAKE_COMPILER_IS_GNUCC AND NOT MINGW AND NOT OS2)
compiler_dumpversion(GNUCC_VERSION)
if (NOT GNUCC_VERSION EQUAL 34)
- check_c_compiler_flag("-fvisibility=hidden" WITH_VISIBILITY_HIDDEN)
+ set(CMAKE_REQUIRED_FLAGS "-fvisibility=hidden")
+ check_c_source_compiles(
+"void __attribute__((visibility(\"default\"))) test() {}
+int main(void){ return 0; }
+" WITH_VISIBILITY_HIDDEN)
+ set(CMAKE_REQUIRED_FLAGS "")
endif (NOT GNUCC_VERSION EQUAL 34)
endif(CMAKE_COMPILER_IS_GNUCC AND NOT MINGW AND NOT OS2)