CMP0067.rst 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. CMP0067
  2. -------
  3. .. versionadded:: 3.8
  4. Honor language standard in :command:`try_compile` source-file signature.
  5. The :command:`try_compile` source file signature is intended to allow
  6. callers to check whether they will be able to compile a given source file
  7. with the current toolchain. In order to match compiler behavior, any
  8. language standard mode should match. However, CMake 3.7 and below did not
  9. do this. CMake 3.8 and above prefer to honor the language standard settings
  10. for ``C``, ``CXX`` (C++), and ``CUDA`` using the values of the variables:
  11. * :variable:`CMAKE_C_STANDARD`
  12. * :variable:`CMAKE_C_STANDARD_REQUIRED`
  13. * :variable:`CMAKE_C_EXTENSIONS`
  14. * :variable:`CMAKE_CXX_STANDARD`
  15. * :variable:`CMAKE_CXX_STANDARD_REQUIRED`
  16. * :variable:`CMAKE_CXX_EXTENSIONS`
  17. * :variable:`CMAKE_CUDA_STANDARD`
  18. * :variable:`CMAKE_CUDA_STANDARD_REQUIRED`
  19. * :variable:`CMAKE_CUDA_EXTENSIONS`
  20. This policy provides compatibility for projects that do not expect
  21. the language standard settings to be used automatically.
  22. The ``OLD`` behavior of this policy is to ignore language standard
  23. setting variables when generating the ``try_compile`` test project.
  24. The ``NEW`` behavior of this policy is to honor language standard
  25. setting variables.
  26. .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.8
  27. .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn by default
  28. .. include:: include/STANDARD_ADVICE.rst
  29. See documentation of the
  30. :variable:`CMAKE_POLICY_WARNING_CMP0067 <CMAKE_POLICY_WARNING_CMP<NNNN>>`
  31. variable to control the warning.
  32. .. include:: include/DEPRECATED.rst