mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-09 00:29:55 -06:00
Merge topic 'gnu-visibility-aix'
e1f0518dGNU: Use -fvisibility on AIX when supportedeae0a85dTests: Remove redundant code from RunCMake.GenerateExportHeader case Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1659
This commit is contained in:
@@ -24,5 +24,7 @@ macro(__aix_compiler_gnu lang)
|
||||
set(CMAKE_${lang}_USE_IMPLICIT_LINK_DIRECTORIES_IN_RUNTIME_PATH 1)
|
||||
|
||||
set(CMAKE_${lang}_LINK_FLAGS "-Wl,-bnoipath")
|
||||
unset(CMAKE_${lang}_COMPILE_OPTIONS_VISIBILITY)
|
||||
if(CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 7 OR CMAKE_SYSTEM_VERSION VERSION_LESS 7.1)
|
||||
unset(CMAKE_${lang}_COMPILE_OPTIONS_VISIBILITY)
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
@@ -53,7 +53,16 @@ endif()
|
||||
|
||||
add_subdirectory(lib_shared_and_static)
|
||||
|
||||
add_compiler_export_flags()
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "AIX" AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU"
|
||||
AND CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY)
|
||||
# With GNU 7 on AIX, passing -fvisibility=hidden when driving the
|
||||
# linker for a shared library drops the so init/destruct symbols.
|
||||
# Just use the modern approach instead of testing the macro.
|
||||
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
|
||||
set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)
|
||||
else()
|
||||
add_compiler_export_flags()
|
||||
endif()
|
||||
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
include(GenerateExportHeader)
|
||||
|
||||
add_compiler_export_flags()
|
||||
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
|
||||
add_library(libshared SHARED libshared.cpp)
|
||||
|
||||
@@ -2,8 +2,6 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
|
||||
include(GenerateExportHeader)
|
||||
|
||||
add_compiler_export_flags()
|
||||
|
||||
# Show that the export header has no effect on a static library.
|
||||
|
||||
add_library(libstatic STATIC libstatic.cpp)
|
||||
|
||||
Reference in New Issue
Block a user