XLClang: Add a new compiler ID for the clang-based XL compiler
This commit is contained in:
parent
e0231fe439
commit
90c6156aa8
@ -57,6 +57,7 @@ function(compiler_id_detection outvar lang)
|
||||
HP
|
||||
Compaq
|
||||
zOS
|
||||
XLClang
|
||||
XL
|
||||
VisualAge
|
||||
PGI
|
||||
|
8
Modules/Compiler/XLClang-C-DetermineCompiler.cmake
Normal file
8
Modules/Compiler/XLClang-C-DetermineCompiler.cmake
Normal file
@ -0,0 +1,8 @@
|
||||
set(_compiler_id_pp_test "defined(__ibmxl__) && defined(__clang__)")
|
||||
|
||||
set(_compiler_id_version_compute "
|
||||
# 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__)
|
||||
")
|
17
Modules/Compiler/XLClang-C.cmake
Normal file
17
Modules/Compiler/XLClang-C.cmake
Normal file
@ -0,0 +1,17 @@
|
||||
include(Compiler/XLClang)
|
||||
__compiler_xlclang(C)
|
||||
|
||||
if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 13.1.1)
|
||||
set(CMAKE_C90_STANDARD_COMPILE_OPTION "-std=c89")
|
||||
set(CMAKE_C90_EXTENSION_COMPILE_OPTION "-std=gnu89")
|
||||
set(CMAKE_C99_STANDARD_COMPILE_OPTION "-std=c99")
|
||||
set(CMAKE_C99_EXTENSION_COMPILE_OPTION "-std=gnu99")
|
||||
set(CMAKE_C11_STANDARD_COMPILE_OPTION "-qlanglvl=extc1x")
|
||||
set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-qlanglvl=extc1x")
|
||||
if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 13.1.2)
|
||||
set(CMAKE_C11_STANDARD_COMPILE_OPTION "-std=c11")
|
||||
set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-std=gnu11")
|
||||
endif ()
|
||||
endif()
|
||||
|
||||
__compiler_check_default_language_standard(C 13.1.1 99)
|
8
Modules/Compiler/XLClang-CXX-DetermineCompiler.cmake
Normal file
8
Modules/Compiler/XLClang-CXX-DetermineCompiler.cmake
Normal file
@ -0,0 +1,8 @@
|
||||
set(_compiler_id_pp_test "defined(__ibmxl__) && defined(__clang__)")
|
||||
|
||||
set(_compiler_id_version_compute "
|
||||
# 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__)
|
||||
")
|
20
Modules/Compiler/XLClang-CXX.cmake
Normal file
20
Modules/Compiler/XLClang-CXX.cmake
Normal file
@ -0,0 +1,20 @@
|
||||
include(Compiler/XLClang)
|
||||
__compiler_xlclang(CXX)
|
||||
|
||||
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 13.1.1)
|
||||
set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "")
|
||||
set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "")
|
||||
set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-qlanglvl=extended0x")
|
||||
set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-qlanglvl=extended0x")
|
||||
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 13.1.2)
|
||||
set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++11")
|
||||
set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=gnu++11")
|
||||
set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "-std=c++1y")
|
||||
set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "-std=gnu++1y")
|
||||
endif ()
|
||||
endif()
|
||||
|
||||
__compiler_check_default_language_standard(CXX 13.1.1 98)
|
||||
|
||||
set(CMAKE_CXX_COMPILE_OBJECT
|
||||
"<CMAKE_CXX_COMPILER> -x c++ <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT> -c <SOURCE>")
|
22
Modules/Compiler/XLClang.cmake
Normal file
22
Modules/Compiler/XLClang.cmake
Normal file
@ -0,0 +1,22 @@
|
||||
# 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_XLCLANG)
|
||||
return()
|
||||
endif()
|
||||
set(__COMPILER_XLCLANG 1)
|
||||
|
||||
include(Compiler/XL)
|
||||
|
||||
macro(__compiler_xlclang lang)
|
||||
__compiler_xl(${lang})
|
||||
|
||||
# Feature flags.
|
||||
set(CMAKE_${lang}_VERBOSE_FLAG "-V")
|
||||
set(CMAKE_${lang}_COMPILE_OPTIONS_PIC "-fPIC")
|
||||
set(CMAKE_${lang}_COMPILE_OPTIONS_PIE "-fPIC")
|
||||
set(CMAKE_${lang}_RESPONSE_FILE_FLAG "@")
|
||||
set(CMAKE_${lang}_RESPONSE_FILE_LINK_FLAG "@")
|
||||
endmacro()
|
2
Modules/Platform/AIX-XLClang-C.cmake
Normal file
2
Modules/Platform/AIX-XLClang-C.cmake
Normal file
@ -0,0 +1,2 @@
|
||||
include(Platform/AIX-XLClang)
|
||||
__aix_compiler_xlclang(C)
|
2
Modules/Platform/AIX-XLClang-CXX.cmake
Normal file
2
Modules/Platform/AIX-XLClang-CXX.cmake
Normal file
@ -0,0 +1,2 @@
|
||||
include(Platform/AIX-XLClang)
|
||||
__aix_compiler_xlclang(CXX)
|
15
Modules/Platform/AIX-XLClang.cmake
Normal file
15
Modules/Platform/AIX-XLClang.cmake
Normal file
@ -0,0 +1,15 @@
|
||||
# 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(__AIX_COMPILER_XLCLANG)
|
||||
return()
|
||||
endif()
|
||||
set(__AIX_COMPILER_XLCLANG 1)
|
||||
|
||||
include(Platform/AIX-XL)
|
||||
|
||||
macro(__aix_compiler_xlclang lang)
|
||||
__aix_compiler_xl(${lang})
|
||||
endmacro()
|
Loading…
Reference in New Issue
Block a user