mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-20 06:48:38 -05:00
Tests: Add case for rejecting $<TARGET_FILE:...> on an INTERFACE library
Add an explicit test for this existing error. We already cover it for an OBJECT library but INTERFACE libraries are not allowed either.
This commit is contained in:
@@ -0,0 +1 @@
|
||||
1
|
||||
@@ -0,0 +1,26 @@
|
||||
CMake Error at BadTargetTypeInterface.cmake:[0-9]+ \(add_custom_target\):
|
||||
Error evaluating generator expression:
|
||||
|
||||
\$<TARGET_FILE:iface>
|
||||
|
||||
Target "iface" is not an executable or library.
|
||||
Call Stack \(most recent call first\):
|
||||
CMakeLists.txt:[0-9]+ \(include\)
|
||||
+
|
||||
CMake Error at BadTargetTypeInterface.cmake:[0-9]+ \(add_custom_target\):
|
||||
Error evaluating generator expression:
|
||||
|
||||
\$<TARGET_SONAME_FILE:iface>
|
||||
|
||||
Target "iface" is not an executable or library.
|
||||
Call Stack \(most recent call first\):
|
||||
CMakeLists.txt:[0-9]+ \(include\)
|
||||
+
|
||||
CMake Error at BadTargetTypeInterface.cmake:[0-9]+ \(add_custom_target\):
|
||||
Error evaluating generator expression:
|
||||
|
||||
\$<TARGET_LINKER_FILE:iface>
|
||||
|
||||
Target "iface" is not an executable or library.
|
||||
Call Stack \(most recent call first\):
|
||||
CMakeLists.txt:[0-9]+ \(include\)
|
||||
@@ -0,0 +1,6 @@
|
||||
add_library(iface INTERFACE)
|
||||
add_custom_target(check ALL COMMAND echo
|
||||
$<TARGET_FILE:iface>
|
||||
$<TARGET_SONAME_FILE:iface>
|
||||
$<TARGET_LINKER_FILE:iface>
|
||||
)
|
||||
@@ -7,6 +7,7 @@ run_cmake(BadNOT)
|
||||
run_cmake(BadStrEqual)
|
||||
run_cmake(BadZero)
|
||||
run_cmake(BadTargetName)
|
||||
run_cmake(BadTargetTypeInterface)
|
||||
run_cmake(BadTargetTypeObject)
|
||||
run_cmake(BadInstallPrefix)
|
||||
run_cmake(CMP0044-WARN)
|
||||
|
||||
Reference in New Issue
Block a user