mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-22 06:59:01 -06:00
cmStandardLevelResolver: Avoid unnecessary flags, fix unset level logic
The changes are part of CMP0128. When the standard level is unset: * Flags are added if extension mode doesn't match the compiler's default. Previously logic only worked if LANG_EXTENSIONS was ON. Fixes #22224. * The full flag is used. Previously CMAKE_LANG_EXTENSION_COMPILE_OPTION was used. This was only supported for IAR. Otherwise: * Avoid adding flags if not necessary per the detected compiler defaults. * Fixed check for when the requested standard is older. It now matches the nearby comments. I reworded the fallback comment as its logic was a bit difficult to wrap my head around.
This commit is contained in:
@@ -32,6 +32,8 @@ only for the policies that do not warn by default:
|
||||
policy :policy:`CMP0116`.
|
||||
* ``CMAKE_POLICY_WARNING_CMP0126`` controls the warning for
|
||||
policy :policy:`CMP0126`.
|
||||
* ``CMAKE_POLICY_WARNING_CMP0128`` controls the warning for
|
||||
policy :policy:`CMP0128`.
|
||||
|
||||
This variable should not be set by a project in CMake code. Project
|
||||
developers running CMake may set this variable in their cache to
|
||||
|
||||
Reference in New Issue
Block a user