summaryrefslogtreecommitdiff
path: root/Tests/RunCMake/InterfaceLibrary/ExcludeFromAll.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/RunCMake/InterfaceLibrary/ExcludeFromAll.cmake')
-rw-r--r--Tests/RunCMake/InterfaceLibrary/ExcludeFromAll.cmake7
1 files changed, 7 insertions, 0 deletions
diff --git a/Tests/RunCMake/InterfaceLibrary/ExcludeFromAll.cmake b/Tests/RunCMake/InterfaceLibrary/ExcludeFromAll.cmake
new file mode 100644
index 000000000..714161df7
--- /dev/null
+++ b/Tests/RunCMake/InterfaceLibrary/ExcludeFromAll.cmake
@@ -0,0 +1,7 @@
+# Test an interface library with a custom command, but excluded from all.
+add_custom_command(OUTPUT iface.txt COMMAND ${CMAKE_COMMAND} -E touch iface.txt)
+add_library(iface INTERFACE EXCLUDE_FROM_ALL iface.txt)
+
+# Test that EXCLUDE_FROM_ALL is allowed even if the interface library has
+# no sources, and does not cause it to appear in the build system.
+add_library(iface2 INTERFACE EXCLUDE_FROM_ALL)