New in version 3.22.
When this policy is set to
Extensions are correctly enabled/disabled if
<LANG>_STANDARDis unset or satisfied by the default.
Standard mode-affecting flags aren't added unless necessary to achieve the specified mode.
Code may need to be updated for the
NEW behavior in the following cases:
If a standard mode flag previously overridden by CMake's and not used during compiler detection now takes effect due to CMake no longer adding one as the default detected is appropriate.
Such code should be converted to either:
If extensions were disabled without
<LANG>_STANDARDbeing set CMake previously wouldn't actually disable extensions.
Such code should be updated to not disable extensions if they are required.
If extensions were enabled/disabled when
<LANG>_STANDARDwas satisfied by the compiler's default CMake previously wouldn't actually enable/disable extensions.
Such code should be updated to set the correct extensions mode.
If compiler flags affecting the standard mode are used during compiler
detection (for example in
a toolchain file
CMAKE_<LANG>_FLAGS_INIT) then they will affect the detected
Unlike many policies, CMake version 3.24.4 does not warn when the policy
is not set and simply uses the
OLD behavior. Use the
cmake_policy() command to set it to
See documentation of the
variable to control the warning.
OLD behavior of a policy is
deprecated by definition
and may be removed in a future version of CMake.