Commit 90c6156a authored by Chuck Atkins's avatar Chuck Atkins Committed by Brad King

XLClang: Add a new compiler ID for the clang-based XL compiler

parent e0231fe4
......@@ -57,6 +57,7 @@ function(compiler_id_detection outvar lang)
HP
Compaq
zOS
XLClang
XL
VisualAge
PGI
......
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__)
")
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)
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__)
")
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>")
# 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()
include(Platform/AIX-XLClang)
__aix_compiler_xlclang(C)
include(Platform/AIX-XLClang)
__aix_compiler_xlclang(CXX)
# 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()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment