FujitsuClang: Add support for the Fujitsu compiler in Clang mode
This should be front end compatible with vanilla clang but giving it a unique identifier allows a project to pass additional options unique to Fujitsu and outside the scope of a CMake builtin.
This commit is contained in:
parent
a55feff69c
commit
27579e9cf1
@ -20,6 +20,7 @@ include:
|
|||||||
Embarcadero, Borland = Embarcadero (embarcadero.com)
|
Embarcadero, Borland = Embarcadero (embarcadero.com)
|
||||||
Flang = Flang LLVM Fortran Compiler
|
Flang = Flang LLVM Fortran Compiler
|
||||||
Fujitsu = Fujitsu HPC compiler (Trad mode)
|
Fujitsu = Fujitsu HPC compiler (Trad mode)
|
||||||
|
FujitsuClang = Fujitsu HPC compiler (Clang mode)
|
||||||
G95 = G95 Fortran (g95.org)
|
G95 = G95 Fortran (g95.org)
|
||||||
GNU = GNU Compiler Collection (gcc.gnu.org)
|
GNU = GNU Compiler Collection (gcc.gnu.org)
|
||||||
GHS = Green Hills Software (www.ghs.com)
|
GHS = Green Hills Software (www.ghs.com)
|
||||||
|
@ -66,6 +66,7 @@ function(compiler_id_detection outvar lang)
|
|||||||
PGI
|
PGI
|
||||||
Cray
|
Cray
|
||||||
TI
|
TI
|
||||||
|
FujitsuClang
|
||||||
Fujitsu
|
Fujitsu
|
||||||
GHS
|
GHS
|
||||||
)
|
)
|
||||||
|
@ -285,6 +285,8 @@ char const info_version_internal[] = {
|
|||||||
'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_',
|
'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_',
|
||||||
'i','n','t','e','r','n','a','l','[',
|
'i','n','t','e','r','n','a','l','[',
|
||||||
COMPILER_VERSION_INTERNAL,']','\0'};
|
COMPILER_VERSION_INTERNAL,']','\0'};
|
||||||
|
#elif defined(COMPILER_VERSION_INTERNAL_STR)
|
||||||
|
char const* info_version_internal = "INFO" ":" "compiler_version_internal[" COMPILER_VERSION_INTERNAL_STR "]";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Construct a string literal encoding the version number components. */
|
/* Construct a string literal encoding the version number components. */
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
set(_compiler_id_pp_test "defined(__FUJITSU) && !defined(__CLANG_FUJITSU)")
|
set(_compiler_id_pp_test "defined(__FUJITSU)")
|
||||||
|
|
||||||
set(_compiler_id_version_compute "
|
set(_compiler_id_version_compute "
|
||||||
# if defined(__FCC_version__)
|
# if defined(__FCC_version__)
|
||||||
|
6
Modules/Compiler/FujitsuClang-C.cmake
Normal file
6
Modules/Compiler/FujitsuClang-C.cmake
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
include(Compiler/FujitsuClang)
|
||||||
|
|
||||||
|
set(_fjclang_ver "${CMAKE_C_COMPILER_VERSION_INTERNAL}")
|
||||||
|
set(CMAKE_C_COMPILER_VERSION "${CMAKE_C_COMPILER_VERSION_INTERNAL}")
|
||||||
|
include(Compiler/Clang-C)
|
||||||
|
set(CMAKE_C_COMPILER_VERSION "${_fjclang_ver}")
|
6
Modules/Compiler/FujitsuClang-CXX.cmake
Normal file
6
Modules/Compiler/FujitsuClang-CXX.cmake
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
include(Compiler/FujitsuClang)
|
||||||
|
|
||||||
|
set(_fjclang_ver "${CMAKE_CXX_COMPILER_VERSION_INTERNAL}")
|
||||||
|
set(CMAKE_CXX_COMPILER_VERSION "${CMAKE_CXX_COMPILER_VERSION_INTERNAL}")
|
||||||
|
include(Compiler/Clang-CXX)
|
||||||
|
set(CMAKE_CXX_COMPILER_VERSION "${_fjclang_ver}")
|
9
Modules/Compiler/FujitsuClang-DetermineCompiler.cmake
Normal file
9
Modules/Compiler/FujitsuClang-DetermineCompiler.cmake
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
|
||||||
|
set(_compiler_id_pp_test "defined(__CLANG_FUJITSU)")
|
||||||
|
|
||||||
|
set(_compiler_id_version_compute "
|
||||||
|
# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__FCC_major__)
|
||||||
|
# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(__FCC_minor__)
|
||||||
|
# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__FCC_patchlevel__)
|
||||||
|
# define @PREFIX@COMPILER_VERSION_INTERNAL_STR __clang_version__
|
||||||
|
")
|
11
Modules/Compiler/FujitsuClang.cmake
Normal file
11
Modules/Compiler/FujitsuClang.cmake
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
# 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_FUJITSUCLANG)
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
set(__COMPILER_FUJITSUCLANG 1)
|
||||||
|
|
||||||
|
include(Compiler/Clang)
|
1
Modules/Platform/Linux-Fujitsu-C.cmake
Normal file
1
Modules/Platform/Linux-Fujitsu-C.cmake
Normal file
@ -0,0 +1 @@
|
|||||||
|
include(Platform/Linux-Clang-C)
|
@ -1,8 +1 @@
|
|||||||
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
include(Platform/Linux-Clang-CXX)
|
||||||
# file Copyright.txt or https://cmake.org/licensing for details
|
|
||||||
|
|
||||||
include(Platform/Linux-Fujitsu)
|
|
||||||
__linux_compiler_fujitsu(CXX)
|
|
||||||
|
|
||||||
# Special sauce to propagate the -std=xxx flag when linking
|
|
||||||
set(CMAKE_CXX_LINK_WITH_STANDARD_COMPILE_OPTION ON)
|
|
||||||
|
Loading…
Reference in New Issue
Block a user