From bcf0cb43f4c98e18cb5dc1f2d452eab547ef54bd Mon Sep 17 00:00:00 2001 From: Bob Friesenhahn Date: Sat, 29 Aug 2015 15:30:28 +0000 Subject: Add ld-version-script option to cmake build. --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 25e45c16..c6e0c40f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -153,6 +153,7 @@ if(MSVC) set(CMAKE_DEBUG_POSTFIX "d") endif() +option(ld-version-script "Enable linker version script" ON) # Check if LD supports linker scripts. file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/conftest.map" "VERS_1 { global: sym; @@ -167,7 +168,7 @@ set(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS} "-Wl,--version-script=${CMAKE_C check_c_source_compiles("int main(void){return 0;}" HAVE_LD_VERSION_SCRIPT) set(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS_SAVE}) file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/conftest.map") -if (HAVE_LD_VERSION_SCRIPT) +if (ld-version-script AND HAVE_LD_VERSION_SCRIPT) set(HAVE_LD_VERSION_SCRIPT TRUE) else() set(HAVE_LD_VERSION_SCRIPT FALSE) -- cgit v1.2.1