summaryrefslogtreecommitdiffstats
path: root/Tests/InterfaceLinkLibraries/foo_link_only.c
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-03-22 15:09:23 (GMT)
committerBrad King <brad.king@kitware.com>2022-03-24 12:23:55 (GMT)
commitcf312a2e5423c49cc5da446f5407a6f4a596a3cb (patch)
tree3bde9691ad13e40b06744b63a2c53dda75cbdf2a /Tests/InterfaceLinkLibraries/foo_link_only.c
parent41a6b4a53ba844ef986b0bc4efe8938b97eea810 (diff)
downloadCMake-cf312a2e5423c49cc5da446f5407a6f4a596a3cb.zip
CMake-cf312a2e5423c49cc5da446f5407a6f4a596a3cb.tar.gz
CMake-cf312a2e5423c49cc5da446f5407a6f4a596a3cb.tar.bz2
LINK_LIBRARIES: Add support for LINK_ONLY genex
Previously we always used content guarded by `$<LINK_ONLY:...>` in `LINK_LIBRARIES`, even when evaluating for non-linking usage requirements. Add a policy to honor `LINK_ONLY` in `LINK_LIBRARIES` the same way we already do in `INTERFACE_LINK_LIBRARIES`.
Diffstat (limited to 'Tests/InterfaceLinkLibraries/foo_link_only.c')
-rw-r--r--Tests/InterfaceLinkLibraries/foo_link_only.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/Tests/InterfaceLinkLibraries/foo_link_only.c b/Tests/InterfaceLinkLibraries/foo_link_only.c
new file mode 100644
index 0000000..9ca1c01
--- /dev/null
+++ b/Tests/InterfaceLinkLibraries/foo_link_only.c
@@ -0,0 +1,8 @@
+#ifndef FOO_LINK_ONLY
+# error "FOO_LINK_ONLY incorrectly not defined"
+#endif
+
+int foo_link_only(void)
+{
+ return 0;
+}