cmake/Help/prop_tgt/COMPILE_OPTIONS.rst

28 lines
1.1 KiB
ReStructuredText
Raw Normal View History

2014-08-03 19:52:23 +02:00
COMPILE_OPTIONS
---------------
List of options to pass to the compiler.
2021-09-14 00:13:48 +02:00
This property holds a :ref:`semicolon-separated list <CMake Language Lists>`
of options specified so far for its target. Use the
:command:`target_compile_options` command to append more options.
2023-05-23 16:38:00 +02:00
The options will be added after flags in the
2021-09-14 00:13:48 +02:00
:variable:`CMAKE_<LANG>_FLAGS` and :variable:`CMAKE_<LANG>_FLAGS_<CONFIG>`
variables, but before those propagated from dependencies by the
:prop_tgt:`INTERFACE_COMPILE_OPTIONS` property.
2014-08-03 19:52:23 +02:00
2023-07-02 19:51:09 +02:00
This property adds compile options for all languages in a target.
Use the :genex:`COMPILE_LANGUAGE` generator expression to specify
per-language compile options.
2016-07-09 11:21:54 +02:00
This property is initialized by the :prop_dir:`COMPILE_OPTIONS` directory
2015-08-17 11:37:30 +02:00
property when a target is created, and is used by the generators to set
the options for the compiler.
2014-08-03 19:52:23 +02:00
Contents of ``COMPILE_OPTIONS`` may use "generator expressions" with the
syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)` manual
for available expressions. See the :manual:`cmake-buildsystem(7)` manual
for more on defining buildsystem properties.
2021-09-14 00:13:48 +02:00
.. include:: ../command/OPTIONS_SHELL.txt