Imported Upstream version 3.11.2
[platform/upstream/cmake.git] / Help / prop_sf / COMPILE_OPTIONS.rst
1 COMPILE_OPTIONS
2 ---------------
3
4 List of additional options to pass to the compiler.
5
6 This property holds a :ref:`;-list <CMake Language Lists>` of options
7 and will be added to the list of compile flags when this
8 source file builds.  Use :prop_sf:`COMPILE_DEFINITIONS` to pass
9 additional preprocessor definitions and :prop_sf:`INCLUDE_DIRECTORIES` to pass
10 additional include directories.
11
12 Contents of ``COMPILE_OPTIONS`` may use "generator expressions" with the
13 syntax ``$<...>``.  See the :manual:`cmake-generator-expressions(7)` manual
14 for available expressions.  However, :generator:`Xcode`
15 does not support per-config per-source settings, so expressions
16 that depend on the build configuration are not allowed with that
17 generator.
18
19 .. note::
20
21   This property should be preferred over the :prop_sf:`COMPILE_FLAGS` property.