Add ld-version-script option to cmake build.

This commit is contained in:
Bob Friesenhahn 2015-08-29 15:30:28 +00:00
parent 036132130d
commit bcf0cb43f4
2 changed files with 13 additions and 1 deletions

View File

@ -153,6 +153,7 @@ if(MSVC)
set(CMAKE_DEBUG_POSTFIX "d") set(CMAKE_DEBUG_POSTFIX "d")
endif() endif()
option(ld-version-script "Enable linker version script" ON)
# Check if LD supports linker scripts. # Check if LD supports linker scripts.
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/conftest.map" "VERS_1 { file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/conftest.map" "VERS_1 {
global: sym; 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) check_c_source_compiles("int main(void){return 0;}" HAVE_LD_VERSION_SCRIPT)
set(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS_SAVE}) set(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS_SAVE})
file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/conftest.map") 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) set(HAVE_LD_VERSION_SCRIPT TRUE)
else() else()
set(HAVE_LD_VERSION_SCRIPT FALSE) set(HAVE_LD_VERSION_SCRIPT FALSE)

View File

@ -1,3 +1,14 @@
2015-08-29 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
* CMakeLists.txt: Applied patch by Roger Leigh (via tiff mailing
list on 2015-08-29) to add ld-version-script option to cmake build
to match autoconf. Note: defaults to 'on' to be ABI-compatible by
default with common Linux distribution builds. Note that the
autoconf configure script defaults to 'off'.
* html/build.html: Applied patch by Roger Leigh (via tiff mailing
list on 2015-08-29) to describe how to use CMake to build libtiff.
2015-08-28 Bob Friesenhahn <bfriesen@simple.dallas.tx.us> 2015-08-28 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
* html/v4.0.5.html: Added HTML file describing the changes which * html/v4.0.5.html: Added HTML file describing the changes which