CMP0155.rst 1.1 KB

123456789101112131415161718192021222324252627
  1. CMP0155
  2. -------
  3. .. versionadded:: 3.28
  4. C++ sources in targets with at least C++20 are scanned for imports
  5. when supported.
  6. CMake 3.27 and below assume that C++ sources do not ``import`` modules.
  7. CMake 3.28 and above prefer to assume that C++ sources in targets using C++20
  8. or higher might ``import`` modules, and must be scanned before compiling,
  9. unless explicitly disabled. This policy provides compatibility for projects
  10. that use C++20 or higher, without modules, that have not been updated to turn
  11. off scanning, e.g., via the :variable:`CMAKE_CXX_SCAN_FOR_MODULES` variable.
  12. See the :manual:`cmake-cxxmodules(7)` manual for more details on C++ module
  13. support.
  14. The ``OLD`` behavior for this policy is to assume that C++ 20 and newer
  15. sources do not import modules. The ``NEW`` behavior for this policy is to
  16. assume that C++ 20 and newer files may import modules if the compiler
  17. understands how to scan for their dependencies, and need to be scanned.
  18. .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.28
  19. .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
  20. .. include:: include/STANDARD_ADVICE.rst
  21. .. include:: include/DEPRECATED.rst