CMake/Help/release/dev/compile-language-features.rst
Stephen Kelly 0dfe395e3c Features: Add COMPILE_FEATURES generator expression.
Allow setting build properties based on the features available
for a target.  The availability of features is determined at
generate-time by evaluating the link implementation.

Ensure that the <LANG>_STANDARD determined while evaluating
COMPILE_FEATURES in the link implementation is not lower than that
provided by the INTERFACE of the link implementation.  This is
similar to handling of transitive properties such as
POSITION_INDEPENDENT_CODE.
2014-05-21 17:22:32 +02:00

29 lines
1.3 KiB
ReStructuredText

target-language-features
------------------------
* New :prop_tgt:`CXX_STANDARD` and :prop_tgt:`CXX_EXTENSIONS` target
properties may specify values which CMake uses to compute required
compile options such as ``-std=c++11`` or ``-std=gnu++11``. The
:variable:`CMAKE_CXX_STANDARD` and :variable:`CMAKE_CXX_EXTENSIONS`
variables may be set to initialize the target properties.
* New :prop_tgt:`C_STANDARD` and :prop_tgt:`C_EXTENSIONS` target
properties may specify values which CMake uses to compute required
compile options such as ``-std=c11`` or ``-std=gnu11``. The
:variable:`CMAKE_C_STANDARD` and :variable:`CMAKE_C_EXTENSIONS`
variables may be set to initialize the target properties.
* New :prop_tgt:`COMPILE_FEATURES` target property may contain a list
of features required to compile a target. CMake uses this
information to ensure that the compiler in use is capable of building
the target, and to add any necessary compile flags to support language
features.
* New :command:`target_compile_features` command allows populating the
:prop_tgt:`COMPILE_FEATURES` target property, just like any other
build variable.
* New ``COMPILE_FEATURES``
:manual:`generator expression <cmake-generator-expressions(7)>` allows
setting build properties based on available compiler features.