mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-07 14:50:15 -05:00
4a0485be7f
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.
10 lines
434 B
CMake
10 lines
434 B
CMake
enable_language(@lang@)
|
|
|
|
# Make sure the compile command is not hidden.
|
|
string(REPLACE "${CMAKE_START_TEMP_FILE}" "" CMAKE_@lang@_COMPILE_OBJECT "${CMAKE_@lang@_COMPILE_OBJECT}")
|
|
string(REPLACE "${CMAKE_END_TEMP_FILE}" "" CMAKE_@lang@_COMPILE_OBJECT "${CMAKE_@lang@_COMPILE_OBJECT}")
|
|
|
|
set(CMAKE_@lang@_EXTENSIONS @extensions_default@)
|
|
set(CMAKE_@lang@_STANDARD @standard_default@)
|
|
add_library(foo "@RunCMake_SOURCE_DIR@/empty.@ext@")
|