summaryrefslogtreecommitdiffstats
path: root/Help
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-06-17 15:06:44 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2016-06-17 15:06:44 (GMT)
commite4cb7d76095c429690255620a101b1a6f66f65df (patch)
treef65370811868c80fa3209bc76fff540182d1f19b /Help
parent5889eb43eaad2e377cee36f813872ddb381b2e43 (diff)
parenta0902efaa747d567fdd35729c8f0dac7b4fbee6d (diff)
downloadCMake-e4cb7d76095c429690255620a101b1a6f66f65df.zip
CMake-e4cb7d76095c429690255620a101b1a6f66f65df.tar.gz
CMake-e4cb7d76095c429690255620a101b1a6f66f65df.tar.bz2
Merge topic 'link_what_you_use'
a0902efa Help: Add notes for topic 'link_what_you_use' 96242f80 Add options to run `ldd -u -r` as a "link-what-you-use" tool
Diffstat (limited to 'Help')
-rw-r--r--Help/manual/cmake-properties.7.rst1
-rw-r--r--Help/manual/cmake-variables.7.rst1
-rw-r--r--Help/prop_tgt/LINK_WHAT_YOU_USE.rst15
-rw-r--r--Help/release/dev/link_what_you_use.rst7
-rw-r--r--Help/variable/CMAKE_LINK_WHAT_YOU_USE.rst6
5 files changed, 30 insertions, 0 deletions
diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst
index 3574b7f..d16f231 100644
--- a/Help/manual/cmake-properties.7.rst
+++ b/Help/manual/cmake-properties.7.rst
@@ -218,6 +218,7 @@ Properties on Targets
/prop_tgt/LINK_LIBRARIES
/prop_tgt/LINK_SEARCH_END_STATIC
/prop_tgt/LINK_SEARCH_START_STATIC
+ /prop_tgt/LINK_WHAT_YOU_USE
/prop_tgt/LOCATION_CONFIG
/prop_tgt/LOCATION
/prop_tgt/MACOSX_BUNDLE_INFO_PLIST
diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst
index 85b8eae..36d00dc 100644
--- a/Help/manual/cmake-variables.7.rst
+++ b/Help/manual/cmake-variables.7.rst
@@ -275,6 +275,7 @@ Variables that Control the Build
/variable/CMAKE_LINK_INTERFACE_LIBRARIES
/variable/CMAKE_LINK_LIBRARY_FILE_FLAG
/variable/CMAKE_LINK_LIBRARY_FLAG
+ /variable/CMAKE_LINK_WHAT_YOU_USE
/variable/CMAKE_MACOSX_BUNDLE
/variable/CMAKE_MACOSX_RPATH
/variable/CMAKE_MAP_IMPORTED_CONFIG_CONFIG
diff --git a/Help/prop_tgt/LINK_WHAT_YOU_USE.rst b/Help/prop_tgt/LINK_WHAT_YOU_USE.rst
new file mode 100644
index 0000000..32d6edb
--- /dev/null
+++ b/Help/prop_tgt/LINK_WHAT_YOU_USE.rst
@@ -0,0 +1,15 @@
+LINK_WHAT_YOU_USE
+---------------------------
+
+This is a boolean option that when set to ``TRUE`` will automatically run
+``ldd -r -u`` on the target after it is linked. In addition, the linker flag
+``-Wl,--no-as-needed`` will be passed to the target with the link command so
+that all libraries specified on the command line will be linked into the
+target. This will result in the link producing a list of libraries that
+provide no symbols used by this target but are being linked to it.
+This is only applicable to executable and shared library targets and
+will only work when ld and ldd accept the flags used.
+
+This property is initialized by the value of
+the :variable:`CMAKE_LINK_WHAT_YOU_USE` variable if it is set
+when a target is created.
diff --git a/Help/release/dev/link_what_you_use.rst b/Help/release/dev/link_what_you_use.rst
new file mode 100644
index 0000000..8d1e598
--- /dev/null
+++ b/Help/release/dev/link_what_you_use.rst
@@ -0,0 +1,7 @@
+link_what_you_use
+-----------------
+
+* A :prop_tgt:`LINK_WHAT_YOU_USE` target property and supporting
+ :variable:`CMAKE_LINK_WHAT_YOU_USE` variable were introduced
+ to detect (on UNIX) shared libraries that are linked but not
+ needed by running ``ldd -r -u``.
diff --git a/Help/variable/CMAKE_LINK_WHAT_YOU_USE.rst b/Help/variable/CMAKE_LINK_WHAT_YOU_USE.rst
new file mode 100644
index 0000000..90c4d3f
--- /dev/null
+++ b/Help/variable/CMAKE_LINK_WHAT_YOU_USE.rst
@@ -0,0 +1,6 @@
+CMAKE_LINK_WHAT_YOU_USE
+---------------------------------
+
+Default value for :prop_tgt:`LINK_WHAT_YOU_USE` target property.
+This variable is used to initialize the property on each target as it is
+created.