summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-12-19 13:03:41 (GMT)
committerKitware Robot <kwrobot@kitware.com>2023-12-19 13:04:01 (GMT)
commit49dc6a44e0602e6a70c0466d789476c8b12fe509 (patch)
tree539e424cae3b245ea5852e6775ee4ea70c61cecf /Tests/RunCMake
parent2cad910ecb39cf19367b89a5489c634ae5ac3375 (diff)
parentdefbfd6f55b2f2fdbb37e6f88867dfaac9180531 (diff)
downloadCMake-49dc6a44e0602e6a70c0466d789476c8b12fe509.zip
CMake-49dc6a44e0602e6a70c0466d789476c8b12fe509.tar.gz
CMake-49dc6a44e0602e6a70c0466d789476c8b12fe509.tar.bz2
Merge topic 'Xcode-Check-Imported-Framework'
defbfd6f55 Xcode: Restore support for standalone IMPORTED_LOCATION_<CONFIG> Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !9082
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r--Tests/RunCMake/target_link_libraries/ImportedTargetPerConfig.cmake27
-rw-r--r--Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake1
2 files changed, 28 insertions, 0 deletions
diff --git a/Tests/RunCMake/target_link_libraries/ImportedTargetPerConfig.cmake b/Tests/RunCMake/target_link_libraries/ImportedTargetPerConfig.cmake
new file mode 100644
index 0000000..a143617
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries/ImportedTargetPerConfig.cmake
@@ -0,0 +1,27 @@
+enable_language(C)
+get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
+if(NOT _isMultiConfig AND NOT CMAKE_BUILD_TYPE)
+ set(CMAKE_BUILD_TYPE "Debug")
+endif()
+
+add_library(StaticImported STATIC IMPORTED)
+
+# Test with no IMPORTED_CONFIGURATIONS, which works if the
+# imported target provides all exact-name configurations
+# built by this project. See issue #25515.
+set_target_properties(StaticImported PROPERTIES
+ IMPORTED_LOCATION_DEBUG "a"
+ IMPORTED_LOCATION_RELEASE "b"
+ IMPORTED_LOCATION_MINSIZEREL "c"
+ IMPORTED_LOCATION_RELWITHDEBINFO "d"
+ )
+
+add_library(StaticLib STATIC empty.c)
+
+# The Xcode generator queries imported targets for system
+# include directories, but without any specific config.
+set_source_files_properties(empty.c PROPERTIES
+ INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}"
+ )
+
+target_link_libraries(StaticLib PRIVATE StaticImported)
diff --git a/Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake b/Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake
index 0e3877a..1bcebb8 100644
--- a/Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake
+++ b/Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake
@@ -25,6 +25,7 @@ run_cmake(CMP0108-NEW-self-link)
run_cmake(ImportedTarget)
run_cmake(ImportedTargetStub)
run_cmake(ImportedTargetFailure)
+run_cmake(ImportedTargetPerConfig)
run_cmake(MixedSignature)
run_cmake(Separate-PRIVATE-LINK_PRIVATE-uses)
run_cmake(SharedDepNotTarget)