diff options
Diffstat (limited to 'Tests/RunCMake')
8 files changed, 40 insertions, 1 deletions
diff --git a/Tests/RunCMake/AutoExportDll/AIXExportExplicit-build-result.txt b/Tests/RunCMake/AutoExportDll/AIXExportExplicit-build-result.txt new file mode 100644 index 0000000..d197c91 --- /dev/null +++ b/Tests/RunCMake/AutoExportDll/AIXExportExplicit-build-result.txt @@ -0,0 +1 @@ +[^0] diff --git a/Tests/RunCMake/AutoExportDll/AIXExportExplicit-build-stdout.txt b/Tests/RunCMake/AutoExportDll/AIXExportExplicit-build-stdout.txt new file mode 100644 index 0000000..760ba3c --- /dev/null +++ b/Tests/RunCMake/AutoExportDll/AIXExportExplicit-build-stdout.txt @@ -0,0 +1 @@ +ERROR: Undefined symbol: .AIXNotExported diff --git a/Tests/RunCMake/AutoExportDll/AIXExportExplicit.cmake b/Tests/RunCMake/AutoExportDll/AIXExportExplicit.cmake new file mode 100644 index 0000000..d23b172 --- /dev/null +++ b/Tests/RunCMake/AutoExportDll/AIXExportExplicit.cmake @@ -0,0 +1,7 @@ +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) diff --git a/Tests/RunCMake/AutoExportDll/AIXExportExplicitLib.c b/Tests/RunCMake/AutoExportDll/AIXExportExplicitLib.c new file mode 100644 index 0000000..58fd5ac --- /dev/null +++ b/Tests/RunCMake/AutoExportDll/AIXExportExplicitLib.c @@ -0,0 +1,8 @@ +int AIXNotExported(void) +{ + return 0; +} +int AIXExportedSymbol(void) +{ + return 0; +} diff --git a/Tests/RunCMake/AutoExportDll/AIXExportExplicitLib.exp b/Tests/RunCMake/AutoExportDll/AIXExportExplicitLib.exp new file mode 100644 index 0000000..9eb7bf8 --- /dev/null +++ b/Tests/RunCMake/AutoExportDll/AIXExportExplicitLib.exp @@ -0,0 +1 @@ +AIXExportedSymbol diff --git a/Tests/RunCMake/AutoExportDll/AIXExportExplicitMain.c b/Tests/RunCMake/AutoExportDll/AIXExportExplicitMain.c new file mode 100644 index 0000000..ad9c8ec --- /dev/null +++ b/Tests/RunCMake/AutoExportDll/AIXExportExplicitMain.c @@ -0,0 +1,7 @@ +extern int AIXNotExported(void); +extern int AIXExportedSymbol(void); + +int main(void) +{ + return AIXNotExported() + AIXExportedSymbol(); +} diff --git a/Tests/RunCMake/AutoExportDll/RunCMakeTest.cmake b/Tests/RunCMake/AutoExportDll/RunCMakeTest.cmake index 6c9be4b..75130f2 100644 --- a/Tests/RunCMake/AutoExportDll/RunCMakeTest.cmake +++ b/Tests/RunCMake/AutoExportDll/RunCMakeTest.cmake @@ -55,3 +55,14 @@ if(EXPORTS) message(SEND_ERROR "\"${EXPORTS_DEF}\" has been updated.") endif() endif() + +function(run_AIXExportExplicit) + set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/AIXExpotExplicit-build") + run_cmake(AIXExportExplicit) + set(RunCMake_TEST_NO_CLEAN 1) + set(RunCMake_TEST_OUTPUT_MERGE TRUE) + run_cmake_command(AIXExportExplicit-build ${CMAKE_COMMAND} --build . --config Debug) +endfunction() +if(CMAKE_SYSTEM_NAME STREQUAL "AIX") + run_AIXExportExplicit() +endif() diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index ad70a34..e9f8bca 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -614,7 +614,10 @@ endif() add_RunCMake_test_group(CPack "${cpack_tests}") # add a test to make sure symbols are exported from a shared library # for MSVC compilers CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS property is used -add_RunCMake_test(AutoExportDll -DCMAKE_CXX_COMPILER_ID=${CMAKE_CXX_COMPILER_ID}) +add_RunCMake_test(AutoExportDll + -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME} + -DCMAKE_CXX_COMPILER_ID=${CMAKE_CXX_COMPILER_ID} + ) add_RunCMake_test(AndroidMK) |