CMP0067.rst 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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. This policy was introduced in CMake version 3.8. Unlike most policies,
  27. CMake version |release| does *not* warn by default when this policy
  28. is not set and simply uses ``OLD`` behavior. See documentation of the
  29. :variable:`CMAKE_POLICY_WARNING_CMP0067 <CMAKE_POLICY_WARNING_CMP<NNNN>>`
  30. variable to control the warning.
  31. .. include:: DEPRECATED.txt