From 18cff26e3aeea532959f080ec1178d611ead3615 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 18 Oct 2018 13:28:28 -0400 Subject: Help: Clarify command-line encoding of target_link_libraries items Items that have full paths will be quoted automatically. Other items are treated as command-line string fragments and get no automatic escaping. Document the behavior for each item kind. Fixes: #18467 --- Help/command/target_link_libraries.rst | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Help/command/target_link_libraries.rst b/Help/command/target_link_libraries.rst index 229d10c..58f312e 100644 --- a/Help/command/target_link_libraries.rst +++ b/Help/command/target_link_libraries.rst @@ -43,6 +43,9 @@ Each ```` may be: the library instead of using the full path (e.g. ``/usr/lib/libfoo.so`` becomes ``-lfoo``). + The full path to the target's artifact will be quoted/escaped for + the shell automatically. + * **A full path to a library file**: The generated link line will normally preserve the full path to the file. The buildsystem will have a dependency to re-link ```` if the library file changes. @@ -62,9 +65,15 @@ Each ```` may be: imported into generated project files. This is not supported by other generators. + The full path to the library file will be quoted/escaped for + the shell automatically. + * **A plain library name**: The generated link line will ask the linker to search for the library (e.g. ``foo`` becomes ``-lfoo`` or ``foo.lib``). + The library name/flag is treated as a command-line string fragment and + will be used with no extra quoting or escaping. + * **A link flag**: Item names starting with ``-``, but not ``-l`` or ``-framework``, are treated as linker flags. Note that such flags will be treated like any other library link item for purposes of transitive @@ -78,6 +87,9 @@ Each ```` may be: flags explicitly. The flags will then be placed at the toolchain-defined flag position in the link command. + The link flag is treated as a command-line string fragment and + will be used with no extra quoting or escaping. + * **A generator expression**: A ``$<...>`` :manual:`generator expression ` may evaluate to any of the above items or to a :ref:`;-list ` of them. -- cgit v0.12