summaryrefslogtreecommitdiffstats
path: root/Tests/InterfaceLinkLibrariesDirect/static_A_private.c
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-01-12 22:14:40 (GMT)
committerBrad King <brad.king@kitware.com>2022-01-29 11:48:13 (GMT)
commitf3ad061858d03cc2a0569f903df3560152106050 (patch)
treebe604880c112a5b7b6eeee586cf2238c4e952c3e /Tests/InterfaceLinkLibrariesDirect/static_A_private.c
parent193a999cd5ed345d79b91dae1fd284248ec93ba2 (diff)
downloadCMake-f3ad061858d03cc2a0569f903df3560152106050.zip
CMake-f3ad061858d03cc2a0569f903df3560152106050.tar.gz
CMake-f3ad061858d03cc2a0569f903df3560152106050.tar.bz2
Add usage requirements to update direct link dependencies
Link line construction starts with `LINK_LIBRARIES` and appends dependencies from the transitive closure of `INTERFACE_LINK_LIBRARIES`. Only the entries of `LINK_LIBRARIES` are considered direct link dependencies. In some advanced use cases, particularly involving static libraries and static plugins, usage requirements need to update the list of direct link dependencies. This may mean adding new items, removing existing items, or both. Add target properties to encode these usage requirements: * INTERFACE_LINK_LIBRARIES_DIRECT * INTERFACE_LINK_LIBRARIES_DIRECT_EXCLUDE Fixes: #22496
Diffstat (limited to 'Tests/InterfaceLinkLibrariesDirect/static_A_private.c')
-rw-r--r--Tests/InterfaceLinkLibrariesDirect/static_A_private.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/Tests/InterfaceLinkLibrariesDirect/static_A_private.c b/Tests/InterfaceLinkLibrariesDirect/static_A_private.c
new file mode 100644
index 0000000..d98a22c
--- /dev/null
+++ b/Tests/InterfaceLinkLibrariesDirect/static_A_private.c
@@ -0,0 +1,16 @@
+#ifndef DEF_DIRECT_FROM_A
+# error "DEF_DIRECT_FROM_A incorrectly not defined"
+#endif
+#ifdef DEF_DIRECT_FROM_A_FOR_EXE
+# error "DEF_DIRECT_FROM_A_FOR_EXE incorrectly defined"
+#endif
+#ifndef DEF_DIRECT_FROM_A_OPTIONAL
+# error "DEF_DIRECT_FROM_A_OPTIONAL incorrectly not defined"
+#endif
+
+extern void a_always(void);
+
+void static_A_private(void)
+{
+ a_always();
+}