diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2018-08-24 15:36:43 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2018-08-27 09:29:24 +0200 |
commit | 4de8ed684bc6a5d5a3b19ee1f2746e4720ad49af (patch) | |
tree | 3496c2d3e4e100c919062521dfb2688e554c74b0 /ConfigureChecks.cmake | |
parent | d0f3cdfa10436d2108e0b75aad53ce976db3e546 (diff) | |
download | libssh-4de8ed684bc6a5d5a3b19ee1f2746e4720ad49af.tar.gz libssh-4de8ed684bc6a5d5a3b19ee1f2746e4720ad49af.tar.xz libssh-4de8ed684bc6a5d5a3b19ee1f2746e4720ad49af.zip |
cmake: Check if the linker supports version scripts
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'ConfigureChecks.cmake')
-rw-r--r-- | ConfigureChecks.cmake | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index b89244f6..57cd0811 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -369,6 +369,20 @@ int main(void) { # Stop treating warnings as errors unset(CMAKE_REQUIRED_FLAGS) +# Check for version script support +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/conftest.map" "VERS_1 { + global: sym; +}; +VERS_2 { + global: sym; +} VERS_1; +") + +set(CMAKE_REQUIRED_FLAGS "-Wl,--version-script=\"${CMAKE_CURRENT_BINARY_DIR}/conftest.map\"") +check_c_source_compiles("int main(void) { return 0; }" HAVE_LD_VERSION_SCRIPT) +unset(CMAKE_REQUIRED_FLAGS) +file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/conftest.map") + if (WITH_DEBUG_CRYPTO) set(DEBUG_CRYPTO 1) endif (WITH_DEBUG_CRYPTO) |