diff options
Diffstat (limited to 'Modules/Compiler')
21 files changed, 78 insertions, 27 deletions
diff --git a/Modules/Compiler/Clang.cmake b/Modules/Compiler/Clang.cmake index 9f5e92181..7ce1adb9d 100644 --- a/Modules/Compiler/Clang.cmake +++ b/Modules/Compiler/Clang.cmake @@ -11,7 +11,8 @@ set(__COMPILER_CLANG 1) include(Compiler/CMakeCommonCompilerMacros) if("x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC" - OR "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC") + OR "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC" + OR "x${CMAKE_Fortran_SIMULATE_ID}" STREQUAL "xMSVC") macro(__compiler_clang lang) endmacro() else() diff --git a/Modules/Compiler/Cray-C.cmake b/Modules/Compiler/Cray-C.cmake index 87ce20f71..d34154c1f 100644 --- a/Modules/Compiler/Cray-C.cmake +++ b/Modules/Compiler/Cray-C.cmake @@ -2,8 +2,7 @@ # file Copyright.txt or https://cmake.org/licensing for details. include(Compiler/Cray) - -set(CMAKE_C_VERBOSE_FLAG "-v") +__compiler_cray(C) string(APPEND CMAKE_C_FLAGS_MINSIZEREL_INIT " -DNDEBUG") string(APPEND CMAKE_C_FLAGS_RELEASE_INIT " -DNDEBUG") diff --git a/Modules/Compiler/Cray-CXX.cmake b/Modules/Compiler/Cray-CXX.cmake index 8506c0942..a1899e6dd 100644 --- a/Modules/Compiler/Cray-CXX.cmake +++ b/Modules/Compiler/Cray-CXX.cmake @@ -2,8 +2,7 @@ # file Copyright.txt or https://cmake.org/licensing for details. include(Compiler/Cray) - -set(CMAKE_CXX_VERBOSE_FLAG "-v") +__compiler_cray(C) string(APPEND CMAKE_CXX_FLAGS_MINSIZEREL_INIT " -DNDEBUG") string(APPEND CMAKE_CXX_FLAGS_RELEASE_INIT " -DNDEBUG") diff --git a/Modules/Compiler/Cray-Fortran.cmake b/Modules/Compiler/Cray-Fortran.cmake index 5d81bb02c..dbf28e3a4 100644 --- a/Modules/Compiler/Cray-Fortran.cmake +++ b/Modules/Compiler/Cray-Fortran.cmake @@ -1,4 +1,9 @@ -set(CMAKE_Fortran_VERBOSE_FLAG "-v") +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Compiler/Cray) +__compiler_cray(Fortran) + set(CMAKE_Fortran_MODOUT_FLAG -em) set(CMAKE_Fortran_MODDIR_FLAG -J) set(CMAKE_Fortran_MODDIR_DEFAULT .) diff --git a/Modules/Compiler/Cray.cmake b/Modules/Compiler/Cray.cmake index 8fe8eebda..c214afc69 100644 --- a/Modules/Compiler/Cray.cmake +++ b/Modules/Compiler/Cray.cmake @@ -8,3 +8,10 @@ endif() set(__COMPILER_CRAY 1) include(Compiler/CMakeCommonCompilerMacros) + +macro(__compiler_cray lang) + set(CMAKE_${lang}_VERBOSE_FLAG "-v") + set(CMAKE_${lang}_COMPILE_OPTIONS_PIC -h PIC) + set(CMAKE_${lang}_COMPILE_OPTIONS_PIE -h PIC) + set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "-h PIC") +endmacro() diff --git a/Modules/Compiler/CrayPrgEnv.cmake b/Modules/Compiler/CrayPrgEnv.cmake index 9f8befda3..05e3fc763 100644 --- a/Modules/Compiler/CrayPrgEnv.cmake +++ b/Modules/Compiler/CrayPrgEnv.cmake @@ -62,12 +62,11 @@ macro(__CrayPrgEnv_setup lang test_src compiler_cmd link_cmd) # Flags for the Cray wrappers set(CMAKE_STATIC_LIBRARY_LINK_${lang}_FLAGS "-static") - set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "") set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-shared") set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS "-dynamic") # If the link type is not explicitly specified in the environment then - # the Cray wrappers assume that the code will be built staticly so + # the Cray wrappers assume that the code will be built statically so # we check the following condition(s) are NOT met # Compiler flags are explicitly dynamic # Env var is dynamic and compiler flags are not explicitly static diff --git a/Modules/Compiler/IAR-FindBinUtils.cmake b/Modules/Compiler/IAR-FindBinUtils.cmake index d662f5615..5fecb2662 100644 --- a/Modules/Compiler/IAR-FindBinUtils.cmake +++ b/Modules/Compiler/IAR-FindBinUtils.cmake @@ -17,7 +17,7 @@ if("${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ARCHITECTURE_ID}" STREQUAL "A find_program(CMAKE_IAR_ARCHIVE iarchive.exe HINTS ${__iar_hints} DOC "The IAR archiver") - # find auxillary tools + # find auxiliary tools find_program(CMAKE_IAR_ELFTOOL ielftool.exe HINTS ${__iar_hints} DOC "The IAR ELF Tool") find_program(CMAKE_IAR_ELFDUMP ielfdumparm.exe HINTS ${__iar_hints} diff --git a/Modules/Compiler/IAR.cmake b/Modules/Compiler/IAR.cmake index 52ebaf20a..43243b9d6 100644 --- a/Modules/Compiler/IAR.cmake +++ b/Modules/Compiler/IAR.cmake @@ -29,7 +29,7 @@ # "Silent" Operation # # this really is different to most programs I know. -# nothing meaningfull from the operation is lost, just some redundant +# nothing meaningful from the operation is lost, just some redundant # code and data size printouts (that can be inspected with common tools). # This module is shared by multiple languages; use include blocker. diff --git a/Modules/Compiler/IBMCPP-C-DetermineVersionInternal.cmake b/Modules/Compiler/IBMCPP-C-DetermineVersionInternal.cmake index 899e284ad..e5b97412e 100644 --- a/Modules/Compiler/IBMCPP-C-DetermineVersionInternal.cmake +++ b/Modules/Compiler/IBMCPP-C-DetermineVersionInternal.cmake @@ -1,6 +1,14 @@ set(_compiler_id_version_compute " - /* __IBMC__ = VRP */ -# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__IBMC__/100) -# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(__IBMC__/10 % 10) -# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__IBMC__ % 10)") +# if defined(__ibmxl__) +# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__ibmxl_version__) +# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(__ibmxl_release__) +# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__ibmxl_modification__) +# define @PREFIX@COMPILER_VERSION_TWEAK @MACRO_DEC@(__ibmxl_ptf_fix_level__) +# else + /* __IBMC__ = VRP */ +# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__IBMC__/100) +# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(__IBMC__/10 % 10) +# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__IBMC__ % 10) +# endif +") diff --git a/Modules/Compiler/IBMCPP-CXX-DetermineVersionInternal.cmake b/Modules/Compiler/IBMCPP-CXX-DetermineVersionInternal.cmake index 73aa2b4f9..63c3e32d6 100644 --- a/Modules/Compiler/IBMCPP-CXX-DetermineVersionInternal.cmake +++ b/Modules/Compiler/IBMCPP-CXX-DetermineVersionInternal.cmake @@ -1,6 +1,14 @@ set(_compiler_id_version_compute " - /* __IBMCPP__ = VRP */ -# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__IBMCPP__/100) -# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(__IBMCPP__/10 % 10) -# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__IBMCPP__ % 10)") +# if defined(__ibmxl__) +# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__ibmxl_version__) +# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(__ibmxl_release__) +# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__ibmxl_modification__) +# define @PREFIX@COMPILER_VERSION_TWEAK @MACRO_DEC@(__ibmxl_ptf_fix_level__) +# else + /* __IBMCPP__ = VRP */ +# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__IBMCPP__/100) +# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(__IBMCPP__/10 % 10) +# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__IBMCPP__ % 10) +# endif +") diff --git a/Modules/Compiler/Intel-C.cmake b/Modules/Compiler/Intel-C.cmake index 4e4af2956..3e0439faf 100644 --- a/Modules/Compiler/Intel-C.cmake +++ b/Modules/Compiler/Intel-C.cmake @@ -25,7 +25,8 @@ else() if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 15.0.0) set(CMAKE_C11_STANDARD_COMPILE_OPTION "-std=c11") - set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-std=gnu11") + # todo: there is no gnu11 value supported; figure out what to do + set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-std=c11") endif() if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 12.0) diff --git a/Modules/Compiler/Intel-CXX-FeatureTests.cmake b/Modules/Compiler/Intel-CXX-FeatureTests.cmake index 929a7c632..bbefe15de 100644 --- a/Modules/Compiler/Intel-CXX-FeatureTests.cmake +++ b/Modules/Compiler/Intel-CXX-FeatureTests.cmake @@ -31,11 +31,6 @@ set(_cmake_feature_test_cxx_aggregate_default_initializers "${Intel16_CXX14}") set(_cmake_feature_test_cxx_contextual_conversions "${Intel16_CXX14}") set(_cmake_feature_test_cxx_generic_lambdas "__cpp_generic_lambdas >= 201304") set(_cmake_feature_test_cxx_digit_separators "${Intel16_CXX14}") -# This test is supposed to work in Intel 14 but the compiler has a bug -# in versions 14 and 15:: -# https://software.intel.com/en-us/forums/intel-c-compiler/topic/600514 -# It also appears to fail with an internal compiler error on Intel 16 and 17. -#set(_cmake_feature_test_cxx_generalized_initializers "${Intel16_CXX14}") unset(Intel16_CXX14) set(Intel15 "__INTEL_COMPILER >= 1500") @@ -75,6 +70,7 @@ set(_cmake_feature_test_cxx_override "${Intel14_CXX11}") set(_cmake_feature_test_cxx_final "${Intel14_CXX11}") set(_cmake_feature_test_cxx_noexcept "${Intel14_CXX11}") set(_cmake_feature_test_cxx_defaulted_move_initializers "${Intel14_CXX11}") +set(_cmake_feature_test_cxx_generalized_initializers "${Intel14_CXX11}") unset(Intel14_CXX11) set(Intel13_CXX11 "__INTEL_COMPILER >= 1300 && ${DETECT_CXX11}") diff --git a/Modules/Compiler/Intel-CXX.cmake b/Modules/Compiler/Intel-CXX.cmake index 0eb9e1fd7..d9c574938 100644 --- a/Modules/Compiler/Intel-CXX.cmake +++ b/Modules/Compiler/Intel-CXX.cmake @@ -9,6 +9,11 @@ set(CMAKE_DEPFILE_FLAGS_CXX "-MD -MT <OBJECT> -MF <DEPFILE>") if("x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC") + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18.0.0) + set(CMAKE_CXX17_STANDARD_COMPILE_OPTION "-Qstd=c++17") + set(CMAKE_CXX17_EXTENSION_COMPILE_OPTION "-Qstd=c++17") + endif() + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 16.0) set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "-Qstd=c++14") set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "-Qstd=c++14") @@ -29,6 +34,12 @@ if("x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC") else() + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18.0.0) + set(CMAKE_CXX17_STANDARD_COMPILE_OPTION "-std=c++17") + # todo: there is no gnu++17 value supported; figure out what to do + set(CMAKE_CXX17_EXTENSION_COMPILE_OPTION "-std=c++17") + endif() + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 15.0.2) set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "-std=c++14") # todo: there is no gnu++14 value supported; figure out what to do diff --git a/Modules/Compiler/MSVC-ASM.cmake b/Modules/Compiler/MSVC-ASM.cmake new file mode 100644 index 000000000..45978c5e2 --- /dev/null +++ b/Modules/Compiler/MSVC-ASM.cmake @@ -0,0 +1 @@ +# This file is loaded when Visual Studio is used for the ASM language. diff --git a/Modules/Compiler/NVIDIA-CUDA.cmake b/Modules/Compiler/NVIDIA-CUDA.cmake index 1c9165458..05db548f5 100644 --- a/Modules/Compiler/NVIDIA-CUDA.cmake +++ b/Modules/Compiler/NVIDIA-CUDA.cmake @@ -33,3 +33,9 @@ else() endif() endif() + +# FIXME: investigate use of --options-file. +# Tell Makefile generator that nvcc does not support @<rspfile> syntax. +set(CMAKE_CUDA_USE_RESPONSE_FILE_FOR_INCLUDES 0) +set(CMAKE_CUDA_USE_RESPONSE_FILE_FOR_LIBRARIES 0) +set(CMAKE_CUDA_USE_RESPONSE_FILE_FOR_OBJECTS 0) diff --git a/Modules/Compiler/SunPro-CXX-FeatureTests.cmake b/Modules/Compiler/SunPro-CXX-FeatureTests.cmake index 60280cadc..279d87538 100644 --- a/Modules/Compiler/SunPro-CXX-FeatureTests.cmake +++ b/Modules/Compiler/SunPro-CXX-FeatureTests.cmake @@ -1,10 +1,14 @@ # Based on GNU 4.8.2 -# http://docs.oracle.com/cd/E37069_01/html/E37071/gncix.html +# https://docs.oracle.com/cd/E37069_01/html/E37071/gncix.html +# https://docs.oracle.com/cd/E77782_01/html/E77784/gkeza.html # Reference: http://gcc.gnu.org/projects/cxx0x.html set(_cmake_oldestSupported "__SUNPRO_CC >= 0x5130") +set(SolarisStudio126_CXX11 "(__SUNPRO_CC >= 0x5150) && __cplusplus >= 201103L") +set(_cmake_feature_test_cxx_decltype_auto "${SolarisStudio126_CXX11}") + set(SolarisStudio125_CXX11 "(__SUNPRO_CC >= 0x5140) && __cplusplus >= 201103L") set(_cmake_feature_test_cxx_binary_literals "${SolarisStudio125_CXX11}") set(_cmake_feature_test_cxx_reference_qualified_functions "${SolarisStudio125_CXX11}") diff --git a/Modules/Compiler/TI-C.cmake b/Modules/Compiler/TI-C.cmake index ebc79f424..e149237d4 100644 --- a/Modules/Compiler/TI-C.cmake +++ b/Modules/Compiler/TI-C.cmake @@ -2,6 +2,8 @@ set(CMAKE_LIBRARY_PATH_FLAG "--search_path=") set(CMAKE_LINK_LIBRARY_FLAG "--library=") set(CMAKE_INCLUDE_FLAG_C "--include_path=") +set(CMAKE_DEPFILE_FLAGS_C "--preproc_with_compile --preproc_dependency=<DEPFILE>") + set(CMAKE_C_CREATE_ASSEMBLY_SOURCE "<CMAKE_C_COMPILER> --compile_only --skip_assembler --c_file=<SOURCE> <DEFINES> <INCLUDES> <FLAGS> --output_file=<ASSEMBLY_SOURCE>") set(CMAKE_C_CREATE_PREPROCESSED_SOURCE "<CMAKE_C_COMPILER> --preproc_only --c_file=<SOURCE> <DEFINES> <INCLUDES> <FLAGS> --output_file=<PREPROCESSED_SOURCE>") diff --git a/Modules/Compiler/TI-CXX.cmake b/Modules/Compiler/TI-CXX.cmake index 4104c3b18..4c6af06cd 100644 --- a/Modules/Compiler/TI-CXX.cmake +++ b/Modules/Compiler/TI-CXX.cmake @@ -2,6 +2,8 @@ set(CMAKE_LIBRARY_PATH_FLAG "--search_path=") set(CMAKE_LINK_LIBRARY_FLAG "--library=") set(CMAKE_INCLUDE_FLAG_CXX "--include_path=") +set(CMAKE_DEPFILE_FLAGS_CXX "--preproc_with_compile --preproc_dependency=<DEPFILE>") + set(CMAKE_CXX_CREATE_ASSEMBLY_SOURCE "<CMAKE_CXX_COMPILER> --compile_only --skip_assembler --cpp_file=<SOURCE> <DEFINES> <INCLUDES> <FLAGS> --output_file=<ASSEMBLY_SOURCE>") set(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE "<CMAKE_CXX_COMPILER> --preproc_only --cpp_file=<SOURCE> <DEFINES> <INCLUDES> <FLAGS> --output_file=<PREPROCESSED_SOURCE>") diff --git a/Modules/Compiler/XL-C-DetermineCompiler.cmake b/Modules/Compiler/XL-C-DetermineCompiler.cmake index 3f4e05c55..484811efe 100644 --- a/Modules/Compiler/XL-C-DetermineCompiler.cmake +++ b/Modules/Compiler/XL-C-DetermineCompiler.cmake @@ -1,4 +1,4 @@ -set(_compiler_id_pp_test "defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ >= 800") +set(_compiler_id_pp_test "defined(__ibmxl__) || (defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ >= 800)") include("${CMAKE_CURRENT_LIST_DIR}/IBMCPP-C-DetermineVersionInternal.cmake") diff --git a/Modules/Compiler/XL-CXX-DetermineCompiler.cmake b/Modules/Compiler/XL-CXX-DetermineCompiler.cmake index dffa4bc21..2bf1ec69c 100644 --- a/Modules/Compiler/XL-CXX-DetermineCompiler.cmake +++ b/Modules/Compiler/XL-CXX-DetermineCompiler.cmake @@ -1,4 +1,4 @@ -set(_compiler_id_pp_test "defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ >= 800") +set(_compiler_id_pp_test "defined(__ibmxl__) || (defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ >= 800)") include("${CMAKE_CURRENT_LIST_DIR}/IBMCPP-CXX-DetermineVersionInternal.cmake") diff --git a/Modules/Compiler/XL.cmake b/Modules/Compiler/XL.cmake index 478378570..e527a049e 100644 --- a/Modules/Compiler/XL.cmake +++ b/Modules/Compiler/XL.cmake @@ -20,6 +20,8 @@ macro(__compiler_xl lang) # Feature flags. set(CMAKE_${lang}_VERBOSE_FLAG "-V") set(CMAKE_${lang}_COMPILE_OPTIONS_PIC "-qpic") + set(CMAKE_${lang}_RESPONSE_FILE_FLAG "-qoptfile=") + set(CMAKE_${lang}_RESPONSE_FILE_LINK_FLAG "-qoptfile=") string(APPEND CMAKE_${lang}_FLAGS_DEBUG_INIT " -g") string(APPEND CMAKE_${lang}_FLAGS_RELEASE_INIT " -O") |