diff options
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/CMakeCompilerIdDetection.cmake | 1 | ||||
-rw-r--r-- | Modules/Compiler/CrayClang-C.cmake | 30 | ||||
-rw-r--r-- | Modules/Compiler/CrayClang-CXX.cmake | 35 | ||||
-rw-r--r-- | Modules/Compiler/CrayClang-DetermineCompiler.cmake | 8 | ||||
-rw-r--r-- | Modules/Compiler/CrayClang.cmake | 17 |
5 files changed, 91 insertions, 0 deletions
diff --git a/Modules/CMakeCompilerIdDetection.cmake b/Modules/CMakeCompilerIdDetection.cmake index eef2bd5..3a2b51f 100644 --- a/Modules/CMakeCompilerIdDetection.cmake +++ b/Modules/CMakeCompilerIdDetection.cmake @@ -65,6 +65,7 @@ function(compiler_id_detection outvar lang) VisualAge NVHPC PGI + CrayClang Cray TI FujitsuClang diff --git a/Modules/Compiler/CrayClang-C.cmake b/Modules/Compiler/CrayClang-C.cmake new file mode 100644 index 0000000..bf878fc --- /dev/null +++ b/Modules/Compiler/CrayClang-C.cmake @@ -0,0 +1,30 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Compiler/CrayClang) +__compiler_cray_clang(C) + +set(CMAKE_C_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c) + +string(APPEND CMAKE_C_FLAGS_MINSIZEREL_INIT " -DNDEBUG") +string(APPEND CMAKE_C_FLAGS_RELEASE_INIT " -DNDEBUG") + +set(CMAKE_C90_STANDARD_COMPILE_OPTION -std=c90) +set(CMAKE_C90_EXTENSION_COMPILE_OPTION -std=gnu90) +set(CMAKE_C90_STANDARD__HAS_FULL_SUPPORT ON) + +set(CMAKE_C99_STANDARD_COMPILE_OPTION -std=c99) +set(CMAKE_C99_EXTENSION_COMPILE_OPTION -std=gnu99) +set(CMAKE_C99_STANDARD__HAS_FULL_SUPPORT ON) + +set(CMAKE_C11_STANDARD_COMPILE_OPTION -std=c11) +set(CMAKE_C11_EXTENSION_COMPILE_OPTION -std=gnu11) +set(CMAKE_C11_STANDARD__HAS_FULL_SUPPORT ON) + +set(CMAKE_C17_STANDARD_COMPILE_OPTION -std=c17) +set(CMAKE_C17_EXTENSION_COMPILE_OPTION -std=gnu17) + +set(CMAKE_C23_STANDARD_COMPILE_OPTION -std=c2x) +set(CMAKE_C23_EXTENSION_COMPILE_OPTION -std=gnu2x) + +__compiler_check_default_language_standard(C 15.0.0 17) diff --git a/Modules/Compiler/CrayClang-CXX.cmake b/Modules/Compiler/CrayClang-CXX.cmake new file mode 100644 index 0000000..de6a53c --- /dev/null +++ b/Modules/Compiler/CrayClang-CXX.cmake @@ -0,0 +1,35 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Compiler/CrayClang) +__compiler_cray_clang(CXX) + + +set(CMAKE_CXX_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c++) +set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-fvisibility-inlines-hidden") + +string(APPEND CMAKE_CXX_FLAGS_MINSIZEREL_INIT " -DNDEBUG") +string(APPEND CMAKE_CXX_FLAGS_RELEASE_INIT " -DNDEBUG") + +set(CMAKE_CXX98_STANDARD_COMPILE_OPTION -std=c++98) +set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION -std=gnu++98) +set(CMAKE_CXX98_STANDARD__HAS_FULL_SUPPORT ON) + +set(CMAKE_CXX11_STANDARD_COMPILE_OPTION -std=c++11) +set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION -std=gnu++11) +set(CMAKE_CXX11_STANDARD__HAS_FULL_SUPPORT ON) + +set(CMAKE_CXX14_STANDARD_COMPILE_OPTION -std=c++14) +set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION -std=gnu++14) +set(CMAKE_CXX14_STANDARD__HAS_FULL_SUPPORT ON) + +set(CMAKE_CXX17_STANDARD_COMPILE_OPTION -std=c++17) +set(CMAKE_CXX17_EXTENSION_COMPILE_OPTION -std=gnu++17) + +set(CMAKE_CXX20_STANDARD_COMPILE_OPTION -std=c++20) +set(CMAKE_CXX20_EXTENSION_COMPILE_OPTION -std=gnu++20) + +set(CMAKE_CXX23_STANDARD_COMPILE_OPTION -std=c++2b) +set(CMAKE_CXX23_EXTENSION_COMPILE_OPTION -std=gnu++2b) + +__compiler_check_default_language_standard(CXX 15.0.0 14) diff --git a/Modules/Compiler/CrayClang-DetermineCompiler.cmake b/Modules/Compiler/CrayClang-DetermineCompiler.cmake new file mode 100644 index 0000000..1828444 --- /dev/null +++ b/Modules/Compiler/CrayClang-DetermineCompiler.cmake @@ -0,0 +1,8 @@ +set(_compiler_id_pp_test "defined(__clang__) && defined(__cray__)") + +set(_compiler_id_version_compute " +# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__cray_major__) +# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(__cray_minor__) +# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__cray_patchlevel__) +# define @PREFIX@COMPILER_VERSION_INTERNAL_STR __clang_version__ +") diff --git a/Modules/Compiler/CrayClang.cmake b/Modules/Compiler/CrayClang.cmake new file mode 100644 index 0000000..d2db9dd --- /dev/null +++ b/Modules/Compiler/CrayClang.cmake @@ -0,0 +1,17 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +# This module is shared by multiple languages; use include blocker. +if(__COMPILER_CRAYCLANG) + return() +endif() +set(__COMPILER_CRAYCLANG 1) + +include(Compiler/Clang) + +macro (__compiler_cray_clang lang) + set(__crayclang_ver "${CMAKE_${lang}_COMPILER_VERSION}") + set("CMAKE_${lang}_COMPILER_VERSION" "${CMAKE_${lang}_COMPILER_VERSION_INTERNAL}") + __compiler_clang(${lang}) + set("CMAKE_${lang}_COMPILER_VERSION" "${__crayclang_ver}") +endmacro () |