Files
CMake/Tests/RunCMake/AutoExportDll/AIXExportExplicit.cmake
Brad King afcd9fe669 AIX: Add an option to disable automatic exports from shared libraries
Since commit 0f150b69d3 (AIX: Explicitly compute shared object exports
for both XL and GNU, 2019-07-11, v3.16.0-rc1~418^2~2) we always export
all symbols from shared libraries by default.  Add a new target property
called `AIX_EXPORT_ALL_SYMBOLS` that can be explicitly set to OFF to
suppress this behavior and export no symbols by default.

Fixes: #20290
2020-01-31 09:34:06 -05:00

8 lines
372 B
CMake

enable_language(C)
set(CMAKE_AIX_EXPORT_ALL_SYMBOLS OFF)
add_library(AIXExportExplicitLib SHARED AIXExportExplicitLib.c)
add_executable(AIXExportExplicitMain AIXExportExplicitMain.c)
target_link_options(AIXExportExplicitLib PRIVATE LINKER:-bE:${CMAKE_CURRENT_SOURCE_DIR}/AIXExportExplicitLib.exp)
target_link_libraries(AIXExportExplicitMain PRIVATE AIXExportExplicitLib)