summaryrefslogtreecommitdiffstats
path: root/Help/command/target_compile_options.rst
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-03-31 15:10:36 (GMT)
committerBrad King <brad.king@kitware.com>2023-03-31 15:30:51 (GMT)
commit561ae21f40d1416aee9a1b63be3b7bafa7b29231 (patch)
treeb5670100f3d4b95cba8dca58fb413ee99abe9028 /Help/command/target_compile_options.rst
parent530faee017ffaabb0315bc81405bdc2ef0995c62 (diff)
downloadCMake-561ae21f40d1416aee9a1b63be3b7bafa7b29231.zip
CMake-561ae21f40d1416aee9a1b63be3b7bafa7b29231.tar.gz
CMake-561ae21f40d1416aee9a1b63be3b7bafa7b29231.tar.bz2
Help: Clarify that {add,target}_compile_options are not used for linking
Link to alternatives that can be used for adding link options. Issue: #24662
Diffstat (limited to 'Help/command/target_compile_options.rst')
-rw-r--r--Help/command/target_compile_options.rst9
1 files changed, 9 insertions, 0 deletions
diff --git a/Help/command/target_compile_options.rst b/Help/command/target_compile_options.rst
index f3ac97b..7cfb24b 100644
--- a/Help/command/target_compile_options.rst
+++ b/Help/command/target_compile_options.rst
@@ -15,6 +15,11 @@ are used when compiling the given ``<target>``, which must have been
created by a command such as :command:`add_executable` or
:command:`add_library` and must not be an :ref:`ALIAS target <Alias Targets>`.
+.. note::
+
+ These options are not used when linking the target.
+ See the :command:`target_link_options` command for that.
+
Arguments
^^^^^^^^^
@@ -60,3 +65,7 @@ See Also
* :command:`target_link_options`
* :command:`target_precompile_headers`
* :command:`target_sources`
+
+* :variable:`CMAKE_<LANG>_FLAGS` and :variable:`CMAKE_<LANG>_FLAGS_<CONFIG>`
+ add language-wide flags passed to all invocations of the compiler.
+ This includes invocations that drive compiling and those that drive linking.