CMP0067.rst 1.5 KB

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