compile-language-features.rst 1.3 KB

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