mirror of
https://github.com/Kitware/CMake.git
synced 2026-03-11 12:00:48 -05:00
Merge topic 'link-libs-config-case'
2af18704fdMerge branch 'backport-3.16-link-libs-config-case'3f976bf201target_link_libraries: Fix regression in case of $<CONFIG> genex5a95b5e091target_link_libraries: Fix regression in case of $<CONFIG> genex Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4544
This commit is contained in:
@@ -0,0 +1 @@
|
||||
1
|
||||
13
Tests/RunCMake/target_link_libraries/ConfigCase-stderr.txt
Normal file
13
Tests/RunCMake/target_link_libraries/ConfigCase-stderr.txt
Normal file
@@ -0,0 +1,13 @@
|
||||
^CMake Error at ConfigCase.cmake:[0-9]+ \(add_library\):
|
||||
Target "impl" links to target "config::impl-Debug" but the target was not
|
||||
found. Perhaps a find_package\(\) call is missing for an IMPORTED target, or
|
||||
an ALIAS target is missing\?
|
||||
Call Stack \(most recent call first\):
|
||||
CMakeLists.txt:[0-9]+ \(include\)
|
||||
+
|
||||
CMake Error at ConfigCase.cmake:[0-9]+ \(add_library\):
|
||||
Target "impl" links to target "config::iface-Debug" but the target was not
|
||||
found. Perhaps a find_package\(\) call is missing for an IMPORTED target, or
|
||||
an ALIAS target is missing\?
|
||||
Call Stack \(most recent call first\):
|
||||
CMakeLists.txt:[0-9]+ \(include\)
|
||||
6
Tests/RunCMake/target_link_libraries/ConfigCase.cmake
Normal file
6
Tests/RunCMake/target_link_libraries/ConfigCase.cmake
Normal file
@@ -0,0 +1,6 @@
|
||||
cmake_policy(VERSION 3.15)
|
||||
enable_language(C)
|
||||
add_library(iface INTERFACE)
|
||||
target_link_libraries(iface INTERFACE "config::iface-$<CONFIG>")
|
||||
add_library(impl empty.c)
|
||||
target_link_libraries(impl PRIVATE "config::impl-$<CONFIG>" iface)
|
||||
@@ -1,5 +1,13 @@
|
||||
include(RunCMake)
|
||||
|
||||
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(ConfigCase)
|
||||
unset(RunCMake_TEST_OPTIONS)
|
||||
|
||||
run_cmake(CMP0023-WARN)
|
||||
run_cmake(CMP0023-NEW)
|
||||
run_cmake(CMP0023-WARN-2)
|
||||
|
||||
Reference in New Issue
Block a user