diff options
author | Brad King <brad.king@kitware.com> | 2023-02-28 13:29:10 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2023-02-28 13:29:20 (GMT) |
commit | 40539096fd47d3ed15d6d87e23b687cf6483034d (patch) | |
tree | 83f8dc7e7b7fc42a6666ac33c828126aff720f25 /Tests/RunCMake | |
parent | 22a491c3ea790532511e8de09692ccd002447c9d (diff) | |
parent | a7f9c7da2618c795db534890124718fd0d9c73ce (diff) | |
download | CMake-40539096fd47d3ed15d6d87e23b687cf6483034d.zip CMake-40539096fd47d3ed15d6d87e23b687cf6483034d.tar.gz CMake-40539096fd47d3ed15d6d87e23b687cf6483034d.tar.bz2 |
Merge topic 'dll-name-soversion'
a7f9c7da26 Add option to add SOVERSION to DLL names
9694504adc Tests: Simplify RunCMake.TargetArtifacts spec
3cd34eb279 Tests: Rename RunCMake.{ArtifactOutputDirs => TargetArtifacts}
Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !8021
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r-- | Tests/RunCMake/CMakeLists.txt | 3 | ||||
-rw-r--r-- | Tests/RunCMake/TargetArtifacts/CMakeLists.txt (renamed from Tests/RunCMake/ArtifactOutputDirs/CMakeLists.txt) | 0 | ||||
-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/OutputDirs.cmake (renamed from Tests/RunCMake/ArtifactOutputDirs/ArtifactOutputDirs.cmake) | 0 | ||||
-rw-r--r-- | Tests/RunCMake/TargetArtifacts/RunCMakeTest.cmake (renamed from Tests/RunCMake/ArtifactOutputDirs/RunCMakeTest.cmake) | 12 | ||||
-rw-r--r-- | Tests/RunCMake/TargetArtifacts/check.cmake (renamed from Tests/RunCMake/ArtifactOutputDirs/check.cmake) | 0 | ||||
-rw-r--r-- | Tests/RunCMake/TargetArtifacts/dll.c | 6 | ||||
-rw-r--r-- | Tests/RunCMake/TargetArtifacts/lib.c (renamed from Tests/RunCMake/ArtifactOutputDirs/lib.c) | 0 | ||||
-rw-r--r-- | Tests/RunCMake/TargetArtifacts/main.c (renamed from Tests/RunCMake/ArtifactOutputDirs/main.c) | 0 |
10 files changed, 33 insertions, 8 deletions
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index e372286..72de742 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -270,8 +270,6 @@ if(want_NoQt_test) add_RunCMake_test(AutogenNoQt TEST_DIR Autogen) endif() -add_RunCMake_test(ArtifactOutputDirs) - if(NOT DEFINED CMake_TEST_BuildDepends_GNU_AS AND (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "LCC") AND CMAKE_GENERATOR MATCHES "^Ninja" @@ -396,6 +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 -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}) add_RunCMake_test(TargetObjects) add_RunCMake_test(TargetProperties) add_RunCMake_test(ToolchainFile) diff --git a/Tests/RunCMake/ArtifactOutputDirs/CMakeLists.txt b/Tests/RunCMake/TargetArtifacts/CMakeLists.txt index ab1a20c..ab1a20c 100644 --- a/Tests/RunCMake/ArtifactOutputDirs/CMakeLists.txt +++ b/Tests/RunCMake/TargetArtifacts/CMakeLists.txt 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/ArtifactOutputDirs/ArtifactOutputDirs.cmake b/Tests/RunCMake/TargetArtifacts/OutputDirs.cmake index d0accd7..d0accd7 100644 --- a/Tests/RunCMake/ArtifactOutputDirs/ArtifactOutputDirs.cmake +++ b/Tests/RunCMake/TargetArtifacts/OutputDirs.cmake diff --git a/Tests/RunCMake/ArtifactOutputDirs/RunCMakeTest.cmake b/Tests/RunCMake/TargetArtifacts/RunCMakeTest.cmake index 1bf8438..de69936 100644 --- a/Tests/RunCMake/ArtifactOutputDirs/RunCMakeTest.cmake +++ b/Tests/RunCMake/TargetArtifacts/RunCMakeTest.cmake @@ -2,18 +2,18 @@ include(RunCMake) function(run_cmake_and_verify_after_build case) set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/${case}-build") - file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") - file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") - set(RunCMake_TEST_NO_CLEAN 1) if(RunCMake_GENERATOR_IS_MULTI_CONFIG) set(RunCMake_TEST_OPTIONS -DCMAKE_CONFIGURATION_TYPES=Debug) else() set(RunCMake_TEST_OPTIONS -DCMAKE_BUILD_TYPE=Debug) endif() run_cmake(${case}) + set(RunCMake_TEST_NO_CLEAN 1) + set(RunCMake_TEST_OUTPUT_MERGE 1) run_cmake_command("${case}-build" ${CMAKE_COMMAND} --build .) - unset(RunCMake_TEST_NO_CLEAN) - unset(RunCMake_TEST_BINARY_DIR) endfunction() -run_cmake_and_verify_after_build(ArtifactOutputDirs) +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/ArtifactOutputDirs/check.cmake b/Tests/RunCMake/TargetArtifacts/check.cmake index ca37eba..ca37eba 100644 --- a/Tests/RunCMake/ArtifactOutputDirs/check.cmake +++ b/Tests/RunCMake/TargetArtifacts/check.cmake 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) +{ +} diff --git a/Tests/RunCMake/ArtifactOutputDirs/lib.c b/Tests/RunCMake/TargetArtifacts/lib.c index 22373f1..22373f1 100644 --- a/Tests/RunCMake/ArtifactOutputDirs/lib.c +++ b/Tests/RunCMake/TargetArtifacts/lib.c diff --git a/Tests/RunCMake/ArtifactOutputDirs/main.c b/Tests/RunCMake/TargetArtifacts/main.c index 8488f4e..8488f4e 100644 --- a/Tests/RunCMake/ArtifactOutputDirs/main.c +++ b/Tests/RunCMake/TargetArtifacts/main.c |