Skip to content
Snippets Groups Projects
Commit 27579e9c authored by Chuck Atkins's avatar Chuck Atkins Committed by Brad King
Browse files

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.
parent a55feff6
No related branches found
No related tags found
No related merge requests found
......@@ -20,6 +20,7 @@ include:
Embarcadero, Borland = Embarcadero (embarcadero.com)
Flang = Flang LLVM Fortran Compiler
Fujitsu = Fujitsu HPC compiler (Trad mode)
FujitsuClang = Fujitsu HPC compiler (Clang mode)
G95 = G95 Fortran (g95.org)
GNU = GNU Compiler Collection (gcc.gnu.org)
GHS = Green Hills Software (www.ghs.com)
......
......@@ -66,6 +66,7 @@ function(compiler_id_detection outvar lang)
PGI
Cray
TI
FujitsuClang
Fujitsu
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','_',
'i','n','t','e','r','n','a','l','[',
COMPILER_VERSION_INTERNAL,']','\0'};
#elif defined(COMPILER_VERSION_INTERNAL_STR)
char const* info_version_internal = "INFO" ":" "compiler_version_internal[" COMPILER_VERSION_INTERNAL_STR "]";
#endif
/* Construct a string literal encoding the version number components. */
......
set(_compiler_id_pp_test "defined(__FUJITSU) && !defined(__CLANG_FUJITSU)")
set(_compiler_id_pp_test "defined(__FUJITSU)")
set(_compiler_id_version_compute "
# if defined(__FCC_version__)
......
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}")
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}")
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__
")
# 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)
include(Platform/Linux-Clang-C)
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# 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)
include(Platform/Linux-Clang-CXX)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment