diff options
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r-- | Tests/RunCMake/CMakeLists.txt | 2 | ||||
-rw-r--r-- | Tests/RunCMake/TargetArtifacts/DLL-SOVERSION-build-stdout.txt | 2 | ||||
-rw-r--r-- | Tests/RunCMake/TargetArtifacts/DLL-SOVERSION.cmake | 18 | ||||
-rw-r--r-- | Tests/RunCMake/TargetArtifacts/RunCMakeTest.cmake | 4 | ||||
-rw-r--r-- | Tests/RunCMake/TargetArtifacts/dll.c | 6 |
5 files changed, 31 insertions, 1 deletions
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 7ec9985..72de742 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -394,7 +394,7 @@ if(UNIX AND CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG AND CMAKE_EXECUTABLE_FORMAT STRE endif() add_RunCMake_test(ScriptMode) add_RunCMake_test(Swift -DCMAKE_Swift_COMPILER=${CMAKE_Swift_COMPILER} -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}) -add_RunCMake_test(TargetArtifacts) +add_RunCMake_test(TargetArtifacts -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}) add_RunCMake_test(TargetObjects) add_RunCMake_test(TargetProperties) add_RunCMake_test(ToolchainFile) diff --git a/Tests/RunCMake/TargetArtifacts/DLL-SOVERSION-build-stdout.txt b/Tests/RunCMake/TargetArtifacts/DLL-SOVERSION-build-stdout.txt new file mode 100644 index 0000000..b375da6 --- /dev/null +++ b/Tests/RunCMake/TargetArtifacts/DLL-SOVERSION-build-stdout.txt @@ -0,0 +1,2 @@ +.*exA_name="(libexA\.so\.2|libexA\.2\.dylib|(lib|cyg|msys-|)exA-2\.dll)" +.*exB_name="(libexB\.so\.2|libexB\.2\.dylib|(lib|cyg|msys-|)exB-2\.dll)" diff --git a/Tests/RunCMake/TargetArtifacts/DLL-SOVERSION.cmake b/Tests/RunCMake/TargetArtifacts/DLL-SOVERSION.cmake new file mode 100644 index 0000000..82eca0b --- /dev/null +++ b/Tests/RunCMake/TargetArtifacts/DLL-SOVERSION.cmake @@ -0,0 +1,18 @@ +enable_language(C) + +add_library(exA SHARED dll.c) +set_target_properties(exA PROPERTIES + SOVERSION 2 + DLL_NAME_WITH_SOVERSION 1 + ) + +set(CMAKE_DLL_NAME_WITH_SOVERSION 1) +add_library(exB SHARED dll.c) +set_property(TARGET exB PROPERTY SOVERSION 2) + +add_custom_target(checkNames ALL + COMMAND ${CMAKE_COMMAND} -E echo exA_name="$<TARGET_FILE_NAME:exA>" + COMMAND ${CMAKE_COMMAND} -E echo exB_name="$<TARGET_FILE_NAME:exB>" + VERBATIM + ) +add_dependencies(checkNames exA exB) diff --git a/Tests/RunCMake/TargetArtifacts/RunCMakeTest.cmake b/Tests/RunCMake/TargetArtifacts/RunCMakeTest.cmake index 2b5c4b8..de69936 100644 --- a/Tests/RunCMake/TargetArtifacts/RunCMakeTest.cmake +++ b/Tests/RunCMake/TargetArtifacts/RunCMakeTest.cmake @@ -9,7 +9,11 @@ function(run_cmake_and_verify_after_build case) endif() run_cmake(${case}) set(RunCMake_TEST_NO_CLEAN 1) + set(RunCMake_TEST_OUTPUT_MERGE 1) run_cmake_command("${case}-build" ${CMAKE_COMMAND} --build .) endfunction() +if(NOT CMAKE_SYSTEM_NAME STREQUAL "AIX") + run_cmake_and_verify_after_build(DLL-SOVERSION) +endif() run_cmake_and_verify_after_build(OutputDirs) diff --git a/Tests/RunCMake/TargetArtifacts/dll.c b/Tests/RunCMake/TargetArtifacts/dll.c new file mode 100644 index 0000000..31e1dbf --- /dev/null +++ b/Tests/RunCMake/TargetArtifacts/dll.c @@ -0,0 +1,6 @@ +#ifdef _WIN32 +__declspec(dllexport) +#endif + void dll(void) +{ +} |