diff options
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/CMakeCCompiler.cmake.in | 1 | ||||
-rw-r--r-- | Modules/CMakeCCompilerId.c.in | 32 | ||||
-rw-r--r-- | Modules/CMakeCUDACompiler.cmake.in | 1 | ||||
-rw-r--r-- | Modules/CMakeCUDACompilerId.cu.in | 15 | ||||
-rw-r--r-- | Modules/CMakeCXXCompiler.cmake.in | 1 | ||||
-rw-r--r-- | Modules/CMakeCXXCompilerId.cpp.in | 16 | ||||
-rw-r--r-- | Modules/CMakeDetermineCUDACompiler.cmake | 5 | ||||
-rw-r--r-- | Modules/CMakeDetermineCompilerId.cmake | 7 | ||||
-rw-r--r-- | Modules/CMakeHIPCompiler.cmake.in | 1 | ||||
-rw-r--r-- | Modules/CMakeHIPCompilerId.hip.in | 13 | ||||
-rw-r--r-- | Modules/CMakeOBJCCompiler.cmake.in | 1 | ||||
-rw-r--r-- | Modules/CMakeOBJCCompilerId.m.in | 29 | ||||
-rw-r--r-- | Modules/CMakeOBJCXXCompiler.cmake.in | 1 | ||||
-rw-r--r-- | Modules/CMakeOBJCXXCompilerId.mm.in | 13 | ||||
-rw-r--r-- | Modules/Compiler/CMakeCommonCompilerMacros.cmake | 18 | ||||
-rw-r--r-- | Modules/Compiler/IAR-ASM.cmake | 2 | ||||
-rw-r--r-- | Modules/Compiler/IAR-C.cmake | 1 | ||||
-rw-r--r-- | Modules/Compiler/IAR-CXX.cmake | 2 | ||||
-rw-r--r-- | Modules/FortranCInterface/Detect.cmake | 3 |
19 files changed, 121 insertions, 41 deletions
diff --git a/Modules/CMakeCCompiler.cmake.in b/Modules/CMakeCCompiler.cmake.in index 6818381..2b24ff2 100644 --- a/Modules/CMakeCCompiler.cmake.in +++ b/Modules/CMakeCCompiler.cmake.in @@ -5,6 +5,7 @@ set(CMAKE_C_COMPILER_VERSION "@CMAKE_C_COMPILER_VERSION@") set(CMAKE_C_COMPILER_VERSION_INTERNAL "@CMAKE_C_COMPILER_VERSION_INTERNAL@") set(CMAKE_C_COMPILER_WRAPPER "@CMAKE_C_COMPILER_WRAPPER@") set(CMAKE_C_STANDARD_COMPUTED_DEFAULT "@CMAKE_C_STANDARD_COMPUTED_DEFAULT@") +set(CMAKE_C_EXTENSIONS_COMPUTED_DEFAULT "@CMAKE_C_EXTENSIONS_COMPUTED_DEFAULT@") set(CMAKE_C_COMPILE_FEATURES "@CMAKE_C_COMPILE_FEATURES@") set(CMAKE_C90_COMPILE_FEATURES "@CMAKE_C90_COMPILE_FEATURES@") set(CMAKE_C99_COMPILE_FEATURES "@CMAKE_C99_COMPILE_FEATURES@") diff --git a/Modules/CMakeCCompilerId.c.in b/Modules/CMakeCCompilerId.c.in index 1f19c00..43ede3e 100644 --- a/Modules/CMakeCCompilerId.c.in +++ b/Modules/CMakeCCompilerId.c.in @@ -41,23 +41,34 @@ char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]"; #if !defined(__STDC__) && !defined(__clang__) # if defined(_MSC_VER) || defined(__ibmxl__) || defined(__IBMC__) -# define C_DIALECT "90" +# define C_VERSION "90" # else -# define C_DIALECT +# define C_VERSION # endif #elif __STDC_VERSION__ > 201710L -# define C_DIALECT "23" +# define C_VERSION "23" #elif __STDC_VERSION__ >= 201710L -# define C_DIALECT "17" +# define C_VERSION "17" #elif __STDC_VERSION__ >= 201000L -# define C_DIALECT "11" +# define C_VERSION "11" #elif __STDC_VERSION__ >= 199901L -# define C_DIALECT "99" +# define C_VERSION "99" #else -# define C_DIALECT "90" +# define C_VERSION "90" #endif -const char* info_language_dialect_default = - "INFO" ":" "dialect_default[" C_DIALECT "]"; +const char* info_language_standard_default = + "INFO" ":" "standard_default[" C_VERSION "]"; + +const char* info_language_extensions_default = "INFO" ":" "extensions_default[" +// !defined(_MSC_VER) to exclude Clang's MSVC compatibility mode. +#if (defined(__clang__) || defined(__GNUC__) || \ + defined(__TI_COMPILER_VERSION__)) && \ + !defined(__STRICT_ANSI__) && !defined(_MSC_VER) + "ON" +#else + "OFF" +#endif +"]"; /*--------------------------------------------------------------------------*/ @@ -89,7 +100,8 @@ int main(int argc, char* argv[]) #if defined(__CRAYXT_COMPUTE_LINUX_TARGET) require += info_cray[argc]; #endif - require += info_language_dialect_default[argc]; + require += info_language_standard_default[argc]; + require += info_language_extensions_default[argc]; (void)argv; return require; } diff --git a/Modules/CMakeCUDACompiler.cmake.in b/Modules/CMakeCUDACompiler.cmake.in index 56ae732..2f3e9a8 100644 --- a/Modules/CMakeCUDACompiler.cmake.in +++ b/Modules/CMakeCUDACompiler.cmake.in @@ -6,6 +6,7 @@ set(CMAKE_CUDA_COMPILER_VERSION "@CMAKE_CUDA_COMPILER_VERSION@") set(CMAKE_CUDA_DEVICE_LINKER "@CMAKE_CUDA_DEVICE_LINKER@") set(CMAKE_CUDA_FATBINARY "@CMAKE_CUDA_FATBINARY@") set(CMAKE_CUDA_STANDARD_COMPUTED_DEFAULT "@CMAKE_CUDA_STANDARD_COMPUTED_DEFAULT@") +set(CMAKE_CUDA_EXTENSIONS_COMPUTED_DEFAULT "@CMAKE_CUDA_EXTENSIONS_COMPUTED_DEFAULT@") set(CMAKE_CUDA_COMPILE_FEATURES "@CMAKE_CUDA_COMPILE_FEATURES@") set(CMAKE_CUDA03_COMPILE_FEATURES "@CMAKE_CUDA03_COMPILE_FEATURES@") set(CMAKE_CUDA11_COMPILE_FEATURES "@CMAKE_CUDA11_COMPILE_FEATURES@") diff --git a/Modules/CMakeCUDACompilerId.cu.in b/Modules/CMakeCUDACompilerId.cu.in index 91039e5..bc685a7 100644 --- a/Modules/CMakeCUDACompilerId.cu.in +++ b/Modules/CMakeCUDACompilerId.cu.in @@ -16,7 +16,7 @@ char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]"; @CMAKE_CUDA_COMPILER_ID_PLATFORM_CONTENT@ @CMAKE_CUDA_COMPILER_ID_ERROR_FOR_TEST@ -const char* info_language_dialect_default = "INFO" ":" "dialect_default[" +const char* info_language_standard_default = "INFO" ":" "standard_default[" #if __cplusplus > 202002L "23" #elif __cplusplus > 201703L @@ -32,6 +32,16 @@ const char* info_language_dialect_default = "INFO" ":" "dialect_default[" #endif "]"; +const char* info_language_extensions_default = "INFO" ":" "extensions_default[" +// !defined(_MSC_VER) to exclude Clang's MSVC compatibility mode. +#if (defined(__clang__) || defined(__GNUC__)) && !defined(__STRICT_ANSI__) && \ + !defined(_MSC_VER) + "ON" +#else + "OFF" +#endif +"]"; + /*--------------------------------------------------------------------------*/ int main(int argc, char* argv[]) @@ -48,7 +58,8 @@ int main(int argc, char* argv[]) #ifdef SIMULATE_VERSION_MAJOR require += info_simulate_version[argc]; #endif - require += info_language_dialect_default[argc]; + require += info_language_standard_default[argc]; + require += info_language_extensions_default[argc]; (void)argv; return require; } diff --git a/Modules/CMakeCXXCompiler.cmake.in b/Modules/CMakeCXXCompiler.cmake.in index 7aad9e2..534e960 100644 --- a/Modules/CMakeCXXCompiler.cmake.in +++ b/Modules/CMakeCXXCompiler.cmake.in @@ -5,6 +5,7 @@ set(CMAKE_CXX_COMPILER_VERSION "@CMAKE_CXX_COMPILER_VERSION@") set(CMAKE_CXX_COMPILER_VERSION_INTERNAL "@CMAKE_CXX_COMPILER_VERSION_INTERNAL@") set(CMAKE_CXX_COMPILER_WRAPPER "@CMAKE_CXX_COMPILER_WRAPPER@") set(CMAKE_CXX_STANDARD_COMPUTED_DEFAULT "@CMAKE_CXX_STANDARD_COMPUTED_DEFAULT@") +set(CMAKE_CXX_EXTENSIONS_COMPUTED_DEFAULT "@CMAKE_CXX_EXTENSIONS_COMPUTED_DEFAULT@") set(CMAKE_CXX_COMPILE_FEATURES "@CMAKE_CXX_COMPILE_FEATURES@") set(CMAKE_CXX98_COMPILE_FEATURES "@CMAKE_CXX98_COMPILE_FEATURES@") set(CMAKE_CXX11_COMPILE_FEATURES "@CMAKE_CXX11_COMPILE_FEATURES@") diff --git a/Modules/CMakeCXXCompilerId.cpp.in b/Modules/CMakeCXXCompilerId.cpp.in index 7362a08..cdf9c18 100644 --- a/Modules/CMakeCXXCompilerId.cpp.in +++ b/Modules/CMakeCXXCompilerId.cpp.in @@ -49,7 +49,7 @@ char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]"; # define CXX_STD __cplusplus #endif -const char* info_language_dialect_default = "INFO" ":" "dialect_default[" +const char* info_language_standard_default = "INFO" ":" "standard_default[" #if CXX_STD > 202002L "23" #elif CXX_STD > 201703L @@ -65,6 +65,17 @@ const char* info_language_dialect_default = "INFO" ":" "dialect_default[" #endif "]"; +const char* info_language_extensions_default = "INFO" ":" "extensions_default[" +// !defined(_MSC_VER) to exclude Clang's MSVC compatibility mode. +#if (defined(__clang__) || defined(__GNUC__) || \ + defined(__TI_COMPILER_VERSION__)) && \ + !defined(__STRICT_ANSI__) && !defined(_MSC_VER) + "ON" +#else + "OFF" +#endif +"]"; + /*--------------------------------------------------------------------------*/ int main(int argc, char* argv[]) @@ -87,7 +98,8 @@ int main(int argc, char* argv[]) #if defined(__CRAYXT_COMPUTE_LINUX_TARGET) require += info_cray[argc]; #endif - require += info_language_dialect_default[argc]; + require += info_language_standard_default[argc]; + require += info_language_extensions_default[argc]; (void)argv; return require; } diff --git a/Modules/CMakeDetermineCUDACompiler.cmake b/Modules/CMakeDetermineCUDACompiler.cmake index 342425c..d06315e 100644 --- a/Modules/CMakeDetermineCUDACompiler.cmake +++ b/Modules/CMakeDetermineCUDACompiler.cmake @@ -441,9 +441,10 @@ elseif(CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA") if("${_nvcc_output_line}" MATCHES "^ *nvlink") string(APPEND _nvcc_log " ignoring nvlink line\n") elseif(_nvcc_libraries) - if("${_nvcc_output_line}" MATCHES "(@\"?tmp/a\\.exe\\.res\"?)") + if("${_nvcc_output_line}" MATCHES "(@\"?((tmp/)?a\\.exe\\.res)\"?)") set(_nvcc_link_res_arg "${CMAKE_MATCH_1}") - set(_nvcc_link_res "${CMAKE_PLATFORM_INFO_DIR}/CompilerIdCUDA/tmp/a.exe.res") + set(_nvcc_link_res_file "${CMAKE_MATCH_2}") + set(_nvcc_link_res "${CMAKE_PLATFORM_INFO_DIR}/CompilerIdCUDA/${_nvcc_link_res_file}") if(EXISTS "${_nvcc_link_res}") file(READ "${_nvcc_link_res}" _nvcc_link_res_content) string(REPLACE "${_nvcc_link_res_arg}" "${_nvcc_link_res_content}" _nvcc_output_line "${_nvcc_output_line}") diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake index d54e2b0..b38de8a 100644 --- a/Modules/CMakeDetermineCompilerId.cmake +++ b/Modules/CMakeDetermineCompilerId.cmake @@ -267,6 +267,7 @@ function(CMAKE_DETERMINE_COMPILER_ID lang flagvar src) set(CMAKE_${lang}_SIMULATE_ID "${CMAKE_${lang}_SIMULATE_ID}" PARENT_SCOPE) set(CMAKE_${lang}_SIMULATE_VERSION "${CMAKE_${lang}_SIMULATE_VERSION}" PARENT_SCOPE) set(CMAKE_${lang}_STANDARD_COMPUTED_DEFAULT "${CMAKE_${lang}_STANDARD_COMPUTED_DEFAULT}" PARENT_SCOPE) + set(CMAKE_${lang}_EXTENSIONS_COMPUTED_DEFAULT "${CMAKE_${lang}_EXTENSIONS_COMPUTED_DEFAULT}" PARENT_SCOPE) set(CMAKE_${lang}_COMPILER_PRODUCED_OUTPUT "${COMPILER_${lang}_PRODUCED_OUTPUT}" PARENT_SCOPE) set(CMAKE_${lang}_COMPILER_PRODUCED_FILES "${COMPILER_${lang}_PRODUCED_FILES}" PARENT_SCOPE) endfunction() @@ -881,9 +882,12 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file) if("${info}" MATCHES "INFO:qnxnto\\[\\]") set(COMPILER_QNXNTO 1) endif() - if("${info}" MATCHES "INFO:dialect_default\\[([^]\"]*)\\]") + if("${info}" MATCHES "INFO:standard_default\\[([^]\"]*)\\]") set(CMAKE_${lang}_STANDARD_COMPUTED_DEFAULT "${CMAKE_MATCH_1}") endif() + if("${info}" MATCHES "INFO:extensions_default\\[([^]\"]*)\\]") + set(CMAKE_${lang}_EXTENSIONS_COMPUTED_DEFAULT "${CMAKE_MATCH_1}") + endif() endforeach() # Construct compiler version from components if needed. @@ -993,6 +997,7 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file) set(CMAKE_${lang}_SIMULATE_VERSION "${CMAKE_${lang}_SIMULATE_VERSION}" PARENT_SCOPE) set(COMPILER_QNXNTO "${COMPILER_QNXNTO}" PARENT_SCOPE) set(CMAKE_${lang}_STANDARD_COMPUTED_DEFAULT "${CMAKE_${lang}_STANDARD_COMPUTED_DEFAULT}" PARENT_SCOPE) + set(CMAKE_${lang}_EXTENSIONS_COMPUTED_DEFAULT "${CMAKE_${lang}_EXTENSIONS_COMPUTED_DEFAULT}" PARENT_SCOPE) endfunction() #----------------------------------------------------------------------------- diff --git a/Modules/CMakeHIPCompiler.cmake.in b/Modules/CMakeHIPCompiler.cmake.in index 17633a8..ce4e2cf 100644 --- a/Modules/CMakeHIPCompiler.cmake.in +++ b/Modules/CMakeHIPCompiler.cmake.in @@ -2,6 +2,7 @@ set(CMAKE_HIP_COMPILER "@CMAKE_HIP_COMPILER@") set(CMAKE_HIP_COMPILER_ID "@CMAKE_HIP_COMPILER_ID@") set(CMAKE_HIP_COMPILER_VERSION "@CMAKE_HIP_COMPILER_VERSION@") set(CMAKE_HIP_STANDARD_COMPUTED_DEFAULT "@CMAKE_HIP_STANDARD_COMPUTED_DEFAULT@") +set(CMAKE_HIP_EXTENSIONS_COMPUTED_DEFAULT "@CMAKE_HIP_EXTENSIONS_COMPUTED_DEFAULT@") set(CMAKE_HIP_COMPILE_FEATURES "@CMAKE_HIP_COMPILE_FEATURES@") set(CMAKE_HIP98_COMPILE_FEATURES "@CMAKE_HIP03_COMPILE_FEATURES@") set(CMAKE_HIP11_COMPILE_FEATURES "@CMAKE_HIP11_COMPILE_FEATURES@") diff --git a/Modules/CMakeHIPCompilerId.hip.in b/Modules/CMakeHIPCompilerId.hip.in index 5258efb..3c4a1d4 100644 --- a/Modules/CMakeHIPCompilerId.hip.in +++ b/Modules/CMakeHIPCompilerId.hip.in @@ -16,7 +16,7 @@ char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]"; @CMAKE_HIP_COMPILER_ID_PLATFORM_CONTENT@ @CMAKE_HIP_COMPILER_ID_ERROR_FOR_TEST@ -const char* info_language_dialect_default = "INFO" ":" "dialect_default[" +const char* info_language_standard_default = "INFO" ":" "standard_default[" #if __cplusplus > 202002L "23" #elif __cplusplus > 201703L @@ -32,6 +32,14 @@ const char* info_language_dialect_default = "INFO" ":" "dialect_default[" #endif "]"; +const char* info_language_extensions_default = "INFO" ":" "extensions_default[" +#if (defined(__clang__) || defined(__GNUC__)) && !defined(__STRICT_ANSI__) + "ON" +#else + "OFF" +#endif +"]"; + /*--------------------------------------------------------------------------*/ int main(int argc, char* argv[]) @@ -48,7 +56,8 @@ int main(int argc, char* argv[]) #ifdef SIMULATE_VERSION_MAJOR require += info_simulate_version[argc]; #endif - require += info_language_dialect_default[argc]; + require += info_language_standard_default[argc]; + require += info_language_extensions_default[argc]; (void)argv; return require; } diff --git a/Modules/CMakeOBJCCompiler.cmake.in b/Modules/CMakeOBJCCompiler.cmake.in index ab67bf3..36f6ec1 100644 --- a/Modules/CMakeOBJCCompiler.cmake.in +++ b/Modules/CMakeOBJCCompiler.cmake.in @@ -5,6 +5,7 @@ set(CMAKE_OBJC_COMPILER_VERSION "@CMAKE_OBJC_COMPILER_VERSION@") set(CMAKE_OBJC_COMPILER_VERSION_INTERNAL "@CMAKE_OBJC_COMPILER_VERSION_INTERNAL@") set(CMAKE_OBJC_COMPILER_WRAPPER "@CMAKE_OBJC_COMPILER_WRAPPER@") set(CMAKE_OBJC_STANDARD_COMPUTED_DEFAULT "@CMAKE_OBJC_STANDARD_COMPUTED_DEFAULT@") +set(CMAKE_OBJC_EXTENSIONS_COMPUTED_DEFAULT "@CMAKE_OBJC_EXTENSIONS_COMPUTED_DEFAULT@") set(CMAKE_OBJC_COMPILE_FEATURES "@CMAKE_OBJC_COMPILE_FEATURES@") set(CMAKE_OBJC90_COMPILE_FEATURES "@CMAKE_OBJC90_COMPILE_FEATURES@") set(CMAKE_OBJC99_COMPILE_FEATURES "@CMAKE_OBJC99_COMPILE_FEATURES@") diff --git a/Modules/CMakeOBJCCompilerId.m.in b/Modules/CMakeOBJCCompilerId.m.in index 418fd48..89bfe02 100644 --- a/Modules/CMakeOBJCCompilerId.m.in +++ b/Modules/CMakeOBJCCompilerId.m.in @@ -23,23 +23,31 @@ char const* qnxnto = "INFO" ":" "qnxnto[]"; #if !defined(__STDC__) # if (defined(_MSC_VER) && !defined(__clang__)) \ || (defined(__ibmxl__) || defined(__IBMC__)) -# define C_DIALECT "90" +# define C_VERSION "90" # else -# define C_DIALECT +# define C_VERSION # endif #elif __STDC_VERSION__ > 201710L -# define C_DIALECT "23" +# define C_VERSION "23" #elif __STDC_VERSION__ >= 201710L -# define C_DIALECT "17" +# define C_VERSION "17" #elif __STDC_VERSION__ >= 201000L -# define C_DIALECT "11" +# define C_VERSION "11" #elif __STDC_VERSION__ >= 199901L -# define C_DIALECT "99" +# define C_VERSION "99" #else -# define C_DIALECT "90" +# define C_VERSION "90" #endif -const char* info_language_dialect_default = - "INFO" ":" "dialect_default[" C_DIALECT "]"; +const char* info_language_standard_default = + "INFO" ":" "standard_default[" C_VERSION "]"; + +const char* info_language_extensions_default = "INFO" ":" "extensions_default[" +#if (defined(__clang__) || defined(__GNUC__)) && !defined(__STRICT_ANSI__) + "ON" +#else + "OFF" +#endif +"]"; /*--------------------------------------------------------------------------*/ @@ -61,7 +69,8 @@ int main(int argc, char* argv[]) #ifdef SIMULATE_VERSION_MAJOR require += info_simulate_version[argc]; #endif - require += info_language_dialect_default[argc]; + require += info_language_standard_default[argc]; + require += info_language_extensions_default[argc]; (void)argv; return require; } diff --git a/Modules/CMakeOBJCXXCompiler.cmake.in b/Modules/CMakeOBJCXXCompiler.cmake.in index a24582b..4f27100 100644 --- a/Modules/CMakeOBJCXXCompiler.cmake.in +++ b/Modules/CMakeOBJCXXCompiler.cmake.in @@ -5,6 +5,7 @@ set(CMAKE_OBJCXX_COMPILER_VERSION "@CMAKE_OBJCXX_COMPILER_VERSION@") set(CMAKE_OBJCXX_COMPILER_VERSION_INTERNAL "@CMAKE_OBJCXX_COMPILER_VERSION_INTERNAL@") set(CMAKE_OBJCXX_COMPILER_WRAPPER "@CMAKE_OBJCXX_COMPILER_WRAPPER@") set(CMAKE_OBJCXX_STANDARD_COMPUTED_DEFAULT "@CMAKE_OBJCXX_STANDARD_COMPUTED_DEFAULT@") +set(CMAKE_OBJCXX_EXTENSIONS_COMPUTED_DEFAULT "@CMAKE_OBJCXX_EXTENSIONS_COMPUTED_DEFAULT@") set(CMAKE_OBJCXX_COMPILE_FEATURES "@CMAKE_OBJCXX_COMPILE_FEATURES@") set(CMAKE_OBJCXX98_COMPILE_FEATURES "@CMAKE_OBJCXX98_COMPILE_FEATURES@") set(CMAKE_OBJCXX11_COMPILE_FEATURES "@CMAKE_OBJCXX11_COMPILE_FEATURES@") diff --git a/Modules/CMakeOBJCXXCompilerId.mm.in b/Modules/CMakeOBJCXXCompilerId.mm.in index e2ac35d..2145b40 100644 --- a/Modules/CMakeOBJCXXCompilerId.mm.in +++ b/Modules/CMakeOBJCXXCompilerId.mm.in @@ -29,7 +29,7 @@ char const* qnxnto = "INFO" ":" "qnxnto[]"; #define CXX_STD __cplusplus #endif -const char* info_language_dialect_default = "INFO" ":" "dialect_default[" +const char* info_language_standard_default = "INFO" ":" "standard_default[" #if CXX_STD > 202002L "23" #elfif CXX_STD > 201703L @@ -45,6 +45,14 @@ const char* info_language_dialect_default = "INFO" ":" "dialect_default[" #endif "]"; +const char* info_language_extensions_default = "INFO" ":" "extensions_default[" +#if (defined(__clang__) || defined(__GNUC__)) && !defined(__STRICT_ANSI__) + "ON" +#else + "OFF" +#endif +"]"; + /*--------------------------------------------------------------------------*/ int main(int argc, char* argv[]) @@ -64,7 +72,8 @@ int main(int argc, char* argv[]) #ifdef SIMULATE_VERSION_MAJOR require += info_simulate_version[argc]; #endif - require += info_language_dialect_default[argc]; + require += info_language_standard_default[argc]; + require += info_language_extensions_default[argc]; (void)argv; return require; } diff --git a/Modules/Compiler/CMakeCommonCompilerMacros.cmake b/Modules/Compiler/CMakeCommonCompilerMacros.cmake index c86af98..2f220d4 100644 --- a/Modules/Compiler/CMakeCommonCompilerMacros.cmake +++ b/Modules/Compiler/CMakeCommonCompilerMacros.cmake @@ -38,20 +38,26 @@ macro(__compiler_check_default_language_standard lang stdver1 std1) # support for language standards, then don't bother. if (CMAKE_${lang}_COMPILER_VERSION VERSION_GREATER_EQUAL "${stdver1}") if (NOT CMAKE_${lang}_COMPILER_FORCED) - if (NOT CMAKE_${lang}_STANDARD_COMPUTED_DEFAULT) - message(FATAL_ERROR "CMAKE_${lang}_STANDARD_COMPUTED_DEFAULT should be set for ${CMAKE_${lang}_COMPILER_ID} (${CMAKE_${lang}_COMPILER}) version ${CMAKE_${lang}_COMPILER_VERSION}") + if (NOT CMAKE_${lang}_STANDARD_COMPUTED_DEFAULT OR NOT DEFINED CMAKE_${lang}_EXTENSIONS_COMPUTED_DEFAULT) + message(FATAL_ERROR "CMAKE_${lang}_STANDARD_COMPUTED_DEFAULT and CMAKE_${lang}_EXTENSIONS_COMPUTED_DEFAULT should be set for ${CMAKE_${lang}_COMPILER_ID} (${CMAKE_${lang}_COMPILER}) version ${CMAKE_${lang}_COMPILER_VERSION}") endif () set(CMAKE_${lang}_STANDARD_DEFAULT ${CMAKE_${lang}_STANDARD_COMPUTED_DEFAULT}) + set(CMAKE_${lang}_EXTENSIONS_DEFAULT ${CMAKE_${lang}_EXTENSIONS_COMPUTED_DEFAULT}) else () list(REVERSE __std_ver_pairs) foreach (__std_ver_pair IN LISTS __std_ver_pairs) string(REGEX MATCH "([^ ]+) (.+)" __std_ver_pair "${__std_ver_pair}") set(__stdver ${CMAKE_MATCH_1}) set(__std ${CMAKE_MATCH_2}) - if (CMAKE_${lang}_COMPILER_VERSION VERSION_GREATER_EQUAL __stdver AND - NOT DEFINED CMAKE_${lang}_STANDARD_DEFAULT) - # Compiler id was forced so just guess the default standard level. - set(CMAKE_${lang}_STANDARD_DEFAULT ${__std}) + # Compiler id was forced so just guess the defaults. + if (CMAKE_${lang}_COMPILER_VERSION VERSION_GREATER_EQUAL __stdver) + if(NOT DEFINED CMAKE_${lang}_EXTENSIONS_DEFAULT) + # Currently known compilers default to enabling extensions. + set(CMAKE_${lang}_EXTENSIONS_DEFAULT ON) + endif() + if(NOT DEFINED CMAKE_${lang}_STANDARD_DEFAULT) + set(CMAKE_${lang}_STANDARD_DEFAULT ${__std}) + endif() endif () unset(__std) unset(__stdver) diff --git a/Modules/Compiler/IAR-ASM.cmake b/Modules/Compiler/IAR-ASM.cmake index 750ac2f..bae0fbd 100644 --- a/Modules/Compiler/IAR-ASM.cmake +++ b/Modules/Compiler/IAR-ASM.cmake @@ -25,7 +25,7 @@ set(CMAKE_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> ${_CMAKE_IAR_SILENCER_FLAG} < if("${CMAKE_ASM${ASM_DIALECT}_COMPILER_ARCHITECTURE_ID}" IN_LIST _CMAKE_IAR_ITOOLS) __compiler_iar_ilink(ASM) - set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s;asm;msa) + set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s;asm;msa;S) elseif("${CMAKE_ASM${ASM_DIALECT}_COMPILER_ARCHITECTURE_ID}" IN_LIST _CMAKE_IAR_XTOOLS) __compiler_iar_xlink(ASM) diff --git a/Modules/Compiler/IAR-C.cmake b/Modules/Compiler/IAR-C.cmake index 9629279..0ef1a2a 100644 --- a/Modules/Compiler/IAR-C.cmake +++ b/Modules/Compiler/IAR-C.cmake @@ -14,6 +14,7 @@ if(NOT DEFINED CMAKE_C_COMPILER_VERSION) message(FATAL_ERROR "CMAKE_C_COMPILER_VERSION not detected. This should be automatic.") endif() +# Unused after CMP0128 set(CMAKE_C_EXTENSION_COMPILE_OPTION -e) if(CMAKE_C_COMPILER_VERSION_INTERNAL VERSION_GREATER 7) diff --git a/Modules/Compiler/IAR-CXX.cmake b/Modules/Compiler/IAR-CXX.cmake index b102aa6..a3f1dbc 100644 --- a/Modules/Compiler/IAR-CXX.cmake +++ b/Modules/Compiler/IAR-CXX.cmake @@ -27,7 +27,7 @@ if(NOT CMAKE_IAR_CXX_FLAG) endif() set(CMAKE_CXX_STANDARD_COMPILE_OPTION "") -set(CMAKE_CXX_EXTENSION_COMPILE_OPTION -e) +set(CMAKE_CXX_EXTENSION_COMPILE_OPTION -e) # Unused after CMP0128 set(CMAKE_CXX${CMAKE_CXX_STANDARD_COMPUTED_DEFAULT}_STANDARD_COMPILE_OPTION "") set(CMAKE_CXX${CMAKE_CXX_STANDARD_COMPUTED_DEFAULT}_EXTENSION_COMPILE_OPTION -e) diff --git a/Modules/FortranCInterface/Detect.cmake b/Modules/FortranCInterface/Detect.cmake index 9e5726b..4d3cb00 100644 --- a/Modules/FortranCInterface/Detect.cmake +++ b/Modules/FortranCInterface/Detect.cmake @@ -8,11 +8,10 @@ configure_file(${FortranCInterface_SOURCE_DIR}/Input.cmake.in # configuration changes. if(NOT EXISTS ${FortranCInterface_BINARY_DIR}/Output.cmake OR NOT EXISTS ${FortranCInterface_BINARY_DIR}/Input.cmake - OR NOT EXISTS ${FortranCInterface_BINARY_DIR}/Output.cmake.in OR NOT ${FortranCInterface_BINARY_DIR}/Output.cmake IS_NEWER_THAN ${FortranCInterface_BINARY_DIR}/Input.cmake OR NOT ${FortranCInterface_SOURCE_DIR}/Output.cmake - IS_NEWER_THAN ${FortranCInterface_BINARY_DIR}/Output.cmake.in + IS_NEWER_THAN ${FortranCInterface_SOURCE_DIR}/Output.cmake.in OR NOT ${FortranCInterface_BINARY_DIR}/Output.cmake IS_NEWER_THAN ${FortranCInterface_SOURCE_DIR}/CMakeLists.txt OR NOT ${FortranCInterface_BINARY_DIR}/Output.cmake |