CMP0132.rst 1.1 KB

123456789101112131415161718192021222324252627
  1. CMP0132
  2. -------
  3. .. versionadded:: 3.24
  4. Do not set compiler environment variables on first run.
  5. Apart from when using the :generator:`Xcode` generator and some :ref:`Visual
  6. Studio Generators`, CMake 3.23 and below will set environment variables like
  7. :envvar:`CC`, :envvar:`CXX`, etc. when the corresponding language is enabled.
  8. This only occurs on the very first time CMake is run in a build directory,
  9. and the environment variables are only defined at configure time, not build
  10. time. On subsequent CMake runs, these environment variables are not set,
  11. opening up the opportunity for different behavior between the first and
  12. subsequent CMake runs. CMake 3.24 and above prefer to not set these
  13. environment variables when a language is enabled, even on the first run in
  14. a build directory.
  15. The ``OLD`` behavior for this policy sets the relevant environment variable
  16. on the first run when a language is enabled. The ``NEW`` behavior for this
  17. policy does not set any such environment variables.
  18. .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.24
  19. .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
  20. .. include:: include/STANDARD_ADVICE.rst
  21. .. include:: include/DEPRECATED.rst