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:
parent
12b9005d7c
commit
89253992b8
|
@ -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(BadStrEqual)
|
||||||
run_cmake(BadZero)
|
run_cmake(BadZero)
|
||||||
run_cmake(BadTargetName)
|
run_cmake(BadTargetName)
|
||||||
|
run_cmake(BadTargetTypeInterface)
|
||||||
run_cmake(BadTargetTypeObject)
|
run_cmake(BadTargetTypeObject)
|
||||||
run_cmake(BadInstallPrefix)
|
run_cmake(BadInstallPrefix)
|
||||||
run_cmake(CMP0044-WARN)
|
run_cmake(CMP0044-WARN)
|
||||||
|
|
Loading…
Reference in New Issue