mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-07-29 13:01:13 +03:00
cmake: Check if the linker supports version scripts
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user