CMP0138.rst 1.2 KB

123456789101112131415161718192021222324252627282930
  1. CMP0138
  2. -------
  3. .. versionadded:: 3.24
  4. :module:`CheckIPOSupported` uses flags from calling project.
  5. The :module:`CheckIPOSupported` module :command:`check_ipo_supported`
  6. command compiles a test project to determine whether the toolchain
  7. supports :prop_tgt:`INTERPROCEDURAL_OPTIMIZATION`. CMake 3.23 and
  8. below run the check with the default values of the
  9. :variable:`CMAKE_<LANG>_FLAGS` and :variable:`CMAKE_<LANG>_FLAGS_<CONFIG>`
  10. variables for the current environment and toolchain settings.
  11. However, some projects may modify these flag variables to add
  12. flags that affect availability of the toolchain's IPO features.
  13. CMake 3.24 and above prefer to honor the calling project's values
  14. for these variables. This policy provides compatibility for projects
  15. that have not been updated to expect this behavior.
  16. The ``OLD`` behavior for this policy is to ignore the calling
  17. project's values of :variable:`CMAKE_<LANG>_FLAGS` and
  18. :variable:`CMAKE_<LANG>_FLAGS_<CONFIG>`. The ``NEW`` behavior
  19. for this policy is to use the values of those variables as
  20. compiler flags in the test project.
  21. .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.24
  22. .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
  23. .. include:: STANDARD_ADVICE.txt
  24. .. include:: DEPRECATED.txt