CMP0066.rst 1.3 KB

1234567891011121314151617181920212223242526272829
  1. CMP0066
  2. -------
  3. .. versionadded:: 3.7
  4. Honor per-config flags in :command:`try_compile` source-file signature.
  5. The source file signature of the :command:`try_compile` command uses the value
  6. of the :variable:`CMAKE_<LANG>_FLAGS` variable in the test project so that the
  7. test compilation works as it would in the main project. However, CMake 3.6 and
  8. below do not also honor config-specific compiler flags such as those in the
  9. :variable:`CMAKE_<LANG>_FLAGS_DEBUG` variable. CMake 3.7 and above prefer to
  10. honor config-specific compiler flags too. This policy provides compatibility
  11. for projects that do not expect config-specific compiler flags to be used.
  12. The ``OLD`` behavior of this policy is to ignore config-specific flag
  13. variables like :variable:`CMAKE_<LANG>_FLAGS_DEBUG` and only use CMake's
  14. built-in defaults for the current compiler and platform.
  15. The ``NEW`` behavior of this policy is to honor config-specific flag
  16. variabldes like :variable:`CMAKE_<LANG>_FLAGS_DEBUG`.
  17. This policy was introduced in CMake version 3.7. Unlike most policies,
  18. CMake version |release| does *not* warn by default when this policy
  19. is not set and simply uses ``OLD`` behavior. See documentation of the
  20. :variable:`CMAKE_POLICY_WARNING_CMP0066 <CMAKE_POLICY_WARNING_CMP<NNNN>>`
  21. variable to control the warning.
  22. .. include:: DEPRECATED.txt