diff options
Diffstat (limited to 'Tests/RunCMake')
11 files changed, 53 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) diff --git a/Tests/RunCMake/GNUInstallDirs/NoSystem-stderr.txt b/Tests/RunCMake/GNUInstallDirs/NoSystem-stderr.txt new file mode 100644 index 0000000..36f064c --- /dev/null +++ b/Tests/RunCMake/GNUInstallDirs/NoSystem-stderr.txt @@ -0,0 +1,8 @@ +^CMake Warning \(dev\) at .*/Modules/GNUInstallDirs.cmake:[0-9]+ \(message\): + Unable to determine default CMAKE_INSTALL_LIBDIR directory because no + target architecture is known. Please enable at least one language before + including GNUInstallDirs. +Call Stack \(most recent call first\): + NoSystem.cmake:[0-9]+ \(include\) + CMakeLists.txt:[0-9]+ \(include\) +This warning is for project developers. Use -Wno-dev to suppress it.$ diff --git a/Tests/RunCMake/GNUInstallDirs/NoSystem.cmake b/Tests/RunCMake/GNUInstallDirs/NoSystem.cmake new file mode 100644 index 0000000..19cf7be --- /dev/null +++ b/Tests/RunCMake/GNUInstallDirs/NoSystem.cmake @@ -0,0 +1,2 @@ +unset(CMAKE_SYSTEM_NAME) +include(GNUInstallDirs) diff --git a/Tests/RunCMake/GNUInstallDirs/RunCMakeTest.cmake b/Tests/RunCMake/GNUInstallDirs/RunCMakeTest.cmake index d671ee0..eb2c1a2 100644 --- a/Tests/RunCMake/GNUInstallDirs/RunCMakeTest.cmake +++ b/Tests/RunCMake/GNUInstallDirs/RunCMakeTest.cmake @@ -16,4 +16,7 @@ foreach(case ) set(RunCMake-stderr-file ${case}${variant}-stderr.txt) run_cmake(${case}) + unset(RunCMake-stderr-file) endforeach() + +run_cmake(NoSystem) |