diff options
author | Brad King <brad.king@kitware.com> | 2020-01-31 14:13:53 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-01-31 14:14:00 (GMT) |
commit | 692527d3b7dd22f2865917df17bfb2e67a08b4a9 (patch) | |
tree | 00b7431c21ed3f50f300cfae8417e83b64090974 /Modules/Platform | |
parent | 0b1ea8d6f1752e43b33a259daeb7454784cc28f5 (diff) | |
parent | a17f6eff4382a9461b412897709e86a58a29c920 (diff) | |
download | CMake-692527d3b7dd22f2865917df17bfb2e67a08b4a9.zip CMake-692527d3b7dd22f2865917df17bfb2e67a08b4a9.tar.gz CMake-692527d3b7dd22f2865917df17bfb2e67a08b4a9.tar.bz2 |
Merge topic 'aix-skip-exports'
a17f6eff43 AIX: Restore pre-3.16 undocumented method to suppress exports with XL
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4303
Diffstat (limited to 'Modules/Platform')
-rw-r--r-- | Modules/Platform/AIX-XL.cmake | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/Modules/Platform/AIX-XL.cmake b/Modules/Platform/AIX-XL.cmake index 64b0bc1..2a67c4f 100644 --- a/Modules/Platform/AIX-XL.cmake +++ b/Modules/Platform/AIX-XL.cmake @@ -18,14 +18,24 @@ macro(__aix_compiler_xl lang) set(CMAKE_${lang}_LINK_FLAGS "-Wl,-bnoipath") + set(_OBJECTS " <OBJECTS>") + if(DEFINED CMAKE_XL_CreateExportList AND CMAKE_XL_CreateExportList STREQUAL "") + # Prior to CMake 3.16, CMAKE_XL_CreateExportList held the path to the XL CreateExportList tool. + # Users could set it to an empty value to skip automatic exports in favor of manual -bE: flags. + # Preserve that behavior for compatibility (even though it was undocumented). + set(_OBJECTS "") + endif() + # Construct the export list ourselves to pass only the object files so # that we export only the symbols actually provided by the sources. set(CMAKE_${lang}_CREATE_SHARED_LIBRARY - "\"${CMAKE_ROOT}/Modules/Platform/AIX/ExportImportList\" -o <OBJECT_DIR>/objects.exp <OBJECTS>" + "\"${CMAKE_ROOT}/Modules/Platform/AIX/ExportImportList\" -o <OBJECT_DIR>/objects.exp${_OBJECTS}" "<CMAKE_${lang}_COMPILER> <CMAKE_SHARED_LIBRARY_${lang}_FLAGS> -Wl,-bE:<OBJECT_DIR>/objects.exp <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>" ) set(CMAKE_${lang}_LINK_EXECUTABLE_WITH_EXPORTS "\"${CMAKE_ROOT}/Modules/Platform/AIX/ExportImportList\" -o <TARGET_IMPLIB> -l . <OBJECTS>" "<CMAKE_${lang}_COMPILER> <FLAGS> <CMAKE_${lang}_LINK_FLAGS> -Wl,-bE:<TARGET_IMPLIB> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>") + + unset(_OBJECTS) endmacro() |