code:
# Reference: http://gcc.gnu.org/projects/cxx0x.html
# http://gcc.gnu.org/projects/cxx1y.html

set(_cmake_oldestSupported "(__GNUC__ * 100 + __GNUC_MINOR__) >= 404")

set(GNU50_CXX14 "(__GNUC__ * 100 + __GNUC_MINOR__) >= 500 && __cplusplus >= 201402L")
set(_cmake_feature_test_cxx_variable_templates "${GNU50_CXX14}")
set(_cmake_feature_test_cxx_relaxed_constexpr "${GNU50_CXX14}")
set(_cmake_feature_test_cxx_aggregate_default_initializers "${GNU50_CXX14}")

# GNU 4.9 in c++14 mode sets __cplusplus to 201300L, so don't test for the
# correct value of it below.
# https://patchwork.ozlabs.org/patch/382470/
set(GNU49_CXX14 "(__GNUC__ * 100 + __GNUC_MINOR__) >= 409 && __cplusplus > 201103L")
set(_cmake_feature_test_cxx_contextual_conversions "${GNU49_CXX14}")
set(_cmake_feature_test_cxx_attribute_deprecated "${GNU49_CXX14}")
set(_cmake_feature_test_cxx_decltype_auto "${GNU49_CXX14}")
set(_cmake_feature_test_cxx_digit_separators "${GNU49_CXX14}")
set(_cmake_feature_test_cxx_generic_lambdas "${GNU49_CXX14}")
# GNU 4.3 supports binary literals as an extension, but may warn about
# use of extensions prior to GNU 4.9
# http://stackoverflow.com/questions/16334024/difference-between-gcc-binary-literals-and-c14-ones
set(_cmake_feature_test_cxx_binary_literals "${GNU49_CXX14}")
# The features below are documented as available in GNU 4.8 (by implementing an
# earlier draft of the standard paper), but that version of the compiler
# does not set __cplusplus to a value greater than 201103L until GNU 4.9:
# http://gcc.gnu.org/onlinedocs/gcc-4.8.2/cpp/Standard-Predefined-Macros.html#Standard-Predefined-Macros
# http://gcc.gnu.org/onlinedocs/gcc-4.9.0/cpp/Standard-Predefined-Macros.html#Standard-Predefined-Macros
# So, CMake only reports availability for it with GNU 4.9 or later.
set(_cmake_feature_test_cxx_return_type_deduction "${GNU49_CXX14}")
set(_cmake_feature_test_cxx_lambda_init_captures "${GNU49_CXX14}")

# Introduced in GCC 4.8.1
set(GNU481_CXX11 "((__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) >= 40801) && __cplusplus >= 201103L")
set(_cmake_feature_test_cxx_decltype_incomplete_return_types "${GNU481_CXX11}")
set(_cmake_feature_test_cxx_reference_qualified_functions "${GNU481_CXX11}")
set(GNU48_CXX11 "(__GNUC__ * 100 + __GNUC_MINOR__) >= 408 && __cplusplus >= 201103L")
set(_cmake_feature_test_cxx_alignas "${GNU48_CXX11}")
# The alignof feature works with GNU 4.7 and -std=c++11, but it is documented
# as available with GNU 4.8, so treat that as true.
set(_cmake_feature_test_cxx_alignof "${GNU48_CXX11}")
set(_cmake_feature_test_cxx_attributes "${GNU48_CXX11}")
set(_cmake_feature_test_cxx_inheriting_constructors "${GNU48_CXX11}")
set(_cmake_feature_test_cxx_thread_local "${GNU48_CXX11}")
set(GNU47_CXX11 "(__GNUC__ * 100 + __GNUC_MINOR__) >= 407 && __cplusplus >= 201103L")
set(_cmake_feature_test_cxx_alias_templates "${GNU47_CXX11}")
set(_cmake_feature_test_cxx_delegating_constructors "${GNU47_CXX11}")
set(_cmake_feature_test_cxx_extended_friend_declarations "${GNU47_CXX11}")
set(_cmake_feature_test_cxx_final "${GNU47_CXX11}")
set(_cmake_feature_test_cxx_nonstatic_member_init "${GNU47_CXX11}")
set(_cmake_feature_test_cxx_override "${GNU47_CXX11}")
set(_cmake_feature_test_cxx_user_literals "${GNU47_CXX11}")
# NOTE: C++11 was ratified in September 2011. GNU 4.7 is the first minor
# release following that (March 2012), and the first minor release to
# support -std=c++11. Prior to that, support for C++11 features is technically
# experimental and possibly incomplete (see for example the note below about
# cxx_variadic_template_template_parameters)
# GNU does not define __cplusplus correctly before version 4.7.
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=1773
# __GXX_EXPERIMENTAL_CXX0X__ is defined in prior versions, but may not be
# defined in the future.
set(GNU_CXX0X_DEFINED "(__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))")
set(GNU46_CXX11 "(__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && ${GNU_CXX0X_DEFINED}")
set(_cmake_feature_test_cxx_constexpr "${GNU46_CXX11}")
set(_cmake_feature_test_cxx_defaulted_move_initializers "${GNU46_CXX11}")
set(_cmake_feature_test_cxx_enum_forward_declarations "${GNU46_CXX11}")
set(_cmake_feature_test_cxx_noexcept "${GNU46_CXX11}")
set(_cmake_feature_test_cxx_nullptr "${GNU46_CXX11}")
set(_cmake_feature_test_cxx_range_for "${GNU46_CXX11}")
set(_cmake_feature_test_cxx_unrestricted_unions "${GNU46_CXX11}")
set(GNU45_CXX11 "(__GNUC__ * 100 + __GNUC_MINOR__) >= 405 && ${GNU_CXX0X_DEFINED}")
set(_cmake_feature_test_cxx_explicit_conversions "${GNU45_CXX11}")
set(_cmake_feature_test_cxx_lambdas "${GNU45_CXX11}")
set(_cmake_feature_test_cxx_local_type_template_args "${GNU45_CXX11}")
set(_cmake_feature_test_cxx_raw_string_literals "${GNU45_CXX11}")
set(GNU44_CXX11 "(__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && ${GNU_CXX0X_DEFINED}")
set(_cmake_feature_test_cxx_auto_type "${GNU44_CXX11}")
set(_cmake_feature_test_cxx_defaulted_functions "${GNU44_CXX11}")
set(_cmake_feature_test_cxx_deleted_functions "${GNU44_CXX11}")
set(_cmake_feature_test_cxx_generalized_initializers "${GNU44_CXX11}")
set(_cmake_feature_test_cxx_inline_namespaces "${GNU44_CXX11}")
set(_cmake_feature_test_cxx_sizeof_member "${GNU44_CXX11}")
set(_cmake_feature_test_cxx_strong_enums "${GNU44_CXX11}")
set(_cmake_feature_test_cxx_trailing_return_types "${GNU44_CXX11}")
set(_cmake_feature_test_cxx_unicode_literals "${GNU44_CXX11}")
set(_cmake_feature_test_cxx_uniform_initialization "${GNU44_CXX11}")
set(_cmake_feature_test_cxx_variadic_templates "${GNU44_CXX11}")
# TODO: If features are ever recorded for GNU 4.3, there should possibly
# be a new feature added like cxx_variadic_template_template_parameters,
# which is implemented by GNU 4.4, but not 4.3. cxx_variadic_templates is
# actually implemented by GNU 4.3, but variadic template template parameters
# 'completes' it, so that is the version we record as having the variadic
# templates capability in CMake. See
# http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2555.pdf
# TODO: Should be supported by GNU 4.3
set(GNU43_CXX11 "${_cmake_oldestSupported} && ${GNU_CXX0X_DEFINED}")
set(_cmake_feature_test_cxx_decltype "${GNU43_CXX11}")
set(_cmake_feature_test_cxx_default_function_template_args "${GNU43_CXX11}")
set(_cmake_feature_test_cxx_long_long_type "${GNU43_CXX11}")
set(_cmake_feature_test_cxx_right_angle_brackets "${GNU43_CXX11}")
set(_cmake_feature_test_cxx_rvalue_references "${GNU43_CXX11}")
set(_cmake_feature_test_cxx_static_assert "${GNU43_CXX11}")
# TODO: Should be supported since GNU 3.4?
set(_cmake_feature_test_cxx_extern_templates "${_cmake_oldestSupported} && ${GNU_CXX0X_DEFINED}")
# TODO: Should be supported forever?
set(_cmake_feature_test_cxx_func_identifier "${_cmake_oldestSupported} && ${GNU_CXX0X_DEFINED}")
set(_cmake_feature_test_cxx_variadic_macros "${_cmake_oldestSupported} && ${GNU_CXX0X_DEFINED}")
set(_cmake_feature_test_cxx_template_template_parameters "${_cmake_oldestSupported} && __cplusplus")


code:
include(Compiler/LCC)
__compiler_lcc(CXX)

if((NOT DEFINED CMAKE_DEPENDS_USE_COMPILER OR CMAKE_DEPENDS_USE_COMPILER)
    AND CMAKE_GENERATOR MATCHES "Makefiles|WMake"
    AND CMAKE_DEPFILE_FLAGS_CXX)
  # dependencies are computed by the compiler itself
  set(CMAKE_CXX_DEPFILE_FORMAT gcc)
  set(CMAKE_CXX_DEPENDS_USE_COMPILER TRUE)
endif()

set(CMAKE_CXX_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c++)

set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-fvisibility-inlines-hidden")

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)

if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 1.20)
  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)
endif()

if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 1.21)
  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)
endif()

if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 1.24)
  set(CMAKE_CXX17_STANDARD_COMPILE_OPTION "-std=c++17")
  set(CMAKE_CXX17_EXTENSION_COMPILE_OPTION "-std=gnu++17")
endif()

if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 1.26)
  set(CMAKE_CXX20_STANDARD_COMPILE_OPTION "-std=c++2a")
  set(CMAKE_CXX20_EXTENSION_COMPILE_OPTION "-std=gnu++2a")
endif()

__compiler_check_default_language_standard(CXX 1.19 98 1.20 11 1.21 14 1.24 17 1.26 20)

repo_name: lazytadpole/codenamesilverfish

license: mit


code:
if(NOT DEFINED _CMAKE_PROCESSING_LANGUAGE OR _CMAKE_PROCESSING_LANGUAGE STREQUAL "")
  message(FATAL_ERROR "Internal error: _CMAKE_PROCESSING_LANGUAGE is not set")
endif()

# Ubuntu 16.04:
# * /usr/bin/gcc-ar-5
# * /usr/bin/gcc-ranlib-5
string(REGEX MATCH "^([0-9]+)" __version_x
    "${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_VERSION}")

string(REGEX MATCH "^([0-9]+\\.[0-9]+)" __version_x_y
    "${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_VERSION}")

# Try to find tools in the same directory as GCC itself
get_filename_component(__gcc_hints "${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER}" DIRECTORY)

# http://manpages.ubuntu.com/manpages/wily/en/man1/gcc-ar.1.html
find_program(CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_AR NAMES
    "${_CMAKE_TOOLCHAIN_PREFIX}gcc-ar-${__version_x_y}"
    "${_CMAKE_TOOLCHAIN_PREFIX}gcc-ar-${__version_x}"
    "${_CMAKE_TOOLCHAIN_PREFIX}gcc-ar${_CMAKE_COMPILER_SUFFIX}"
    HINTS ${__gcc_hints}
    NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH
    DOC "A wrapper around 'ar' adding the appropriate '--plugin' option for the GCC compiler"
)
mark_as_advanced(CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_AR)

# http://manpages.ubuntu.com/manpages/wily/en/man1/gcc-ranlib.1.html
find_program(CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_RANLIB NAMES
    "${_CMAKE_TOOLCHAIN_PREFIX}gcc-ranlib-${__version_x_y}"
    "${_CMAKE_TOOLCHAIN_PREFIX}gcc-ranlib-${__version_x}"
    "${_CMAKE_TOOLCHAIN_PREFIX}gcc-ranlib${_CMAKE_COMPILER_SUFFIX}"
    HINTS ${__gcc_hints}
    NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH
    DOC "A wrapper around 'ranlib' adding the appropriate '--plugin' option for the GCC compiler"
)
mark_as_advanced(CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_RANLIB)


code:
include(Compiler/LCC)
__compiler_lcc(Fortran)

set(CMAKE_Fortran_SUBMODULE_SEP "@")
set(CMAKE_Fortran_SUBMODULE_EXT ".smod")

set(CMAKE_Fortran_PREPROCESS_SOURCE
  "<CMAKE_Fortran_COMPILER> -cpp <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> -o <PREPROCESSED_SOURCE>")

set(CMAKE_Fortran_FORMAT_FIXED_FLAG "-ffixed-form")
set(CMAKE_Fortran_FORMAT_FREE_FLAG "-ffree-form")

# LCC < 1.24.00 has a broken Fortran preprocessor
if(CMAKE_Fortran_COMPILER_VERSION VERSION_GREATER_EQUAL "1.24.00")
  set(CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_ON "-cpp")
  set(CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_OFF "-nocpp")
endif()

set(CMAKE_Fortran_POSTPROCESS_FLAG "-fpreprocessed")

# No -DNDEBUG for Fortran.
string(APPEND CMAKE_Fortran_FLAGS_MINSIZEREL_INIT " -Os")
string(APPEND CMAKE_Fortran_FLAGS_RELEASE_INIT " -O3")

# No -isystem for Fortran because it will not find .mod files.
unset(CMAKE_INCLUDE_SYSTEM_FLAG_Fortran)

# Fortran-specific feature flags.
set(CMAKE_Fortran_MODDIR_FLAG -J)


code:
# 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_LCC)
  return()
endif()
set(__COMPILER_LCC 1)

include(Compiler/CMakeCommonCompilerMacros)

set(__pch_header_C "c-header")
set(__pch_header_CXX "c++-header")
set(__pch_header_OBJC "objective-c-header")
set(__pch_header_OBJCXX "objective-c++-header")

macro(__compiler_lcc lang)
  # Feature flags.
  set(CMAKE_${lang}_VERBOSE_FLAG "-v")
  set(CMAKE_${lang}_COMPILE_OPTIONS_WARNING_AS_ERROR "-Werror")
  set(CMAKE_${lang}_COMPILE_OPTIONS_PIC "-fPIC")
  set (_CMAKE_${lang}_PIE_MAY_BE_SUPPORTED_BY_LINKER NO)
  set(CMAKE_${lang}_COMPILE_OPTIONS_PIE "-fPIE")
  # Support of PIE at link stage depends on various elements : platform, compiler, linker
  # so to activate it, module CheckPIESupported must be used.
  set (_CMAKE_${lang}_PIE_MAY_BE_SUPPORTED_BY_LINKER YES)
  set(CMAKE_${lang}_LINK_OPTIONS_PIE ${CMAKE_${lang}_COMPILE_OPTIONS_PIE} "-pie")
  set(CMAKE_${lang}_LINK_OPTIONS_NO_PIE "-no-pie")
  set(CMAKE_${lang}_COMPILE_OPTIONS_VISIBILITY "-fvisibility=")
  set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "-fPIC")
  set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-shared")
  set(CMAKE_${lang}_COMPILE_OPTIONS_SYSROOT "--sysroot=")

  set(CMAKE_${lang}_LINKER_WRAPPER_FLAG "-Wl,")
  set(CMAKE_${lang}_LINKER_WRAPPER_FLAG_SEP ",")

  # Older versions of gcc (< 4.5) contain a bug causing them to report a missing
  # header file as a warning if depfiles are enabled, causing check_header_file
  # tests to always succeed.  Work around this by disabling dependency tracking
  # in try_compile mode.
  get_property(_IN_TC GLOBAL PROPERTY IN_TRY_COMPILE)
  if(CMAKE_${lang}_COMPILER_ID STREQUAL "LCC" AND _IN_TC AND NOT CMAKE_FORCE_DEPFILES)
  else()
    # distcc does not transform -o to -MT when invoking the preprocessor
    # internally, as it ought to.  Work around this bug by setting -MT here
    # even though it isn't strictly necessary.
    set(CMAKE_DEPFILE_FLAGS_${lang} "-MD -MT <DEP_TARGET> -MF <DEP_FILE>")
  endif()

  # Initial configuration flags.
  string(APPEND CMAKE_${lang}_FLAGS_INIT " ")
  string(APPEND CMAKE_${lang}_FLAGS_DEBUG_INIT " -g")
  string(APPEND CMAKE_${lang}_FLAGS_MINSIZEREL_INIT " -Os -DNDEBUG")
  string(APPEND CMAKE_${lang}_FLAGS_RELEASE_INIT " -O3 -DNDEBUG")
  string(APPEND CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT " -O2 -g -DNDEBUG")
  set(CMAKE_${lang}_CREATE_PREPROCESSED_SOURCE "<CMAKE_${lang}_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
  set(CMAKE_${lang}_CREATE_ASSEMBLY_SOURCE "<CMAKE_${lang}_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
  set(CMAKE_INCLUDE_SYSTEM_FLAG_${lang} "-isystem ")
  set(_CMAKE_${lang}_IPO_SUPPORTED_BY_CMAKE YES)
  set(_CMAKE_${lang}_IPO_MAY_BE_SUPPORTED_BY_COMPILER NO)
  set(_CMAKE_${lang}_IPO_MAY_BE_SUPPORTED_BY_COMPILER YES)
  set(__lto_flags -flto)
  list(APPEND __lto_flags -fno-fat-lto-objects)
  set(CMAKE_${lang}_COMPILE_OPTIONS_IPO ${__lto_flags})

  set(CMAKE_${lang}_ARCHIVE_CREATE_IPO
    "\"${CMAKE_${lang}_COMPILER_AR}\" qc <TARGET> <LINK_FLAGS> <OBJECTS>"
  )

  set(CMAKE_${lang}_ARCHIVE_APPEND_IPO
    "\"${CMAKE_${lang}_COMPILER_AR}\" q <TARGET> <LINK_FLAGS> <OBJECTS>"
  )

  set(CMAKE_${lang}_ARCHIVE_FINISH_IPO
    "\"${CMAKE_${lang}_COMPILER_RANLIB}\" <TARGET>"
  )

  if("${lang}" STREQUAL "CXX")
    set(CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "${CMAKE_${lang}_COMPILER}")
    if(CMAKE_${lang}_COMPILER_ARG1)
      separate_arguments(_COMPILER_ARGS NATIVE_COMMAND "${CMAKE_${lang}_COMPILER_ARG1}")
      list(APPEND CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND ${_COMPILER_ARGS})
      unset(_COMPILER_ARGS)
    endif()
    list(APPEND CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "-dM" "-E" "-c" "${CMAKE_ROOT}/Modules/CMakeCXXCompilerABI.cpp")
  endif()

  if(NOT "x${lang}" STREQUAL "xFortran")
    set(CMAKE_PCH_EXTENSION .gch)
    if (NOT CMAKE_GENERATOR MATCHES "Xcode")
      set(CMAKE_PCH_PROLOGUE "#pragma GCC system_header")
    endif()
    set(CMAKE_${lang}_COMPILE_OPTIONS_INVALID_PCH -Winvalid-pch)
    set(CMAKE_${lang}_COMPILE_OPTIONS_USE_PCH -include <PCH_HEADER>)
    set(CMAKE_${lang}_COMPILE_OPTIONS_CREATE_PCH -x ${__pch_header_${lang}} -include <PCH_HEADER>)
  endif()
endmacro()


code:
set(CMAKE_Fortran_SUBMODULE_SEP "-")
set(CMAKE_Fortran_SUBMODULE_EXT ".mod")

set(CMAKE_Fortran_PREPROCESS_SOURCE
    "<CMAKE_Fortran_COMPILER> -cpp <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")

set(CMAKE_Fortran_FORMAT_FIXED_FLAG "-ffixed-form")
set(CMAKE_Fortran_FORMAT_FREE_FLAG "-ffree-form")

set(CMAKE_Fortran_MODDIR_FLAG "-module-dir")

set(CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_ON "-cpp")
set(CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_OFF "-nocpp")
set(CMAKE_Fortran_POSTPROCESS_FLAG "-ffixed-line-length-72")

set(CMAKE_Fortran_COMPILE_OPTIONS_TARGET "--target=")

set(CMAKE_Fortran_LINKER_WRAPPER_FLAG "-Wl,")
set(CMAKE_Fortran_LINKER_WRAPPER_FLAG_SEP ",")

if(NOT "x${CMAKE_Fortran_SIMULATE_ID}" STREQUAL "xMSVC")
  set(CMAKE_Fortran_VERBOSE_FLAG "-v")

  string(APPEND CMAKE_Fortran_FLAGS_DEBUG_INIT " -O0 -g")
  string(APPEND CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT " -O2 -g")
  string(APPEND CMAKE_Fortran_FLAGS_RELEASE_INIT " -O3")
endif()


code: # This file is loaded when Visual Studio is used for the ASM language.


code:
set(_cmake_oldestSupported "_MSC_VER >= 1600")

set(_cmake_feature_test_c_restrict "_MSC_VER >= 1927")
set(_cmake_feature_test_c_static_assert "_MSC_VER >= 1928")

set(_cmake_feature_test_c_variadic_macros "${_cmake_oldestSupported}")
set(_cmake_feature_test_c_function_prototypes "${_cmake_oldestSupported}")


code:
# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.

include(Compiler/MSVC)
__compiler_msvc(C)

include(Compiler/CMakeCommonCompilerMacros)

if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 19.27)
  set(CMAKE_C90_STANDARD_COMPILE_OPTION "")
  set(CMAKE_C90_EXTENSION_COMPILE_OPTION "")
  set(CMAKE_C99_STANDARD_COMPILE_OPTION "")
  set(CMAKE_C99_EXTENSION_COMPILE_OPTION "")
  set(CMAKE_C11_STANDARD_COMPILE_OPTION "-std:c11")
  set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-std:c11")

  if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 19.28)
    set(CMAKE_C90_STANDARD__HAS_FULL_SUPPORT ON)
    set(CMAKE_C99_STANDARD__HAS_FULL_SUPPORT ON)
    set(CMAKE_C11_STANDARD__HAS_FULL_SUPPORT ON)
    set(CMAKE_C17_STANDARD_COMPILE_OPTION "-std:c17")
    set(CMAKE_C17_EXTENSION_COMPILE_OPTION "-std:c17")
  else()
    # Special case for 19.27 (VS 16.7): C11 has partial support.
    macro(cmake_record_c_compile_features)
      _has_compiler_features_c(90)
      _has_compiler_features_c(99)
      list(APPEND CMAKE_C11_COMPILE_FEATURES c_std_11)
      set(_result 0) # expected by cmake_determine_compile_features
    endmacro()
  endif()

  __compiler_check_default_language_standard(C 19.27 99)
else()
  # MSVC has no specific options to set C language standards, but set them as
  # empty strings anyways so the feature test infrastructure can at least check
  # to see if they are defined.
  set(CMAKE_C90_STANDARD_COMPILE_OPTION "")
  set(CMAKE_C90_EXTENSION_COMPILE_OPTION "")
  set(CMAKE_C99_STANDARD_COMPILE_OPTION "")
  set(CMAKE_C99_EXTENSION_COMPILE_OPTION "")
  set(CMAKE_C11_STANDARD_COMPILE_OPTION "")
  set(CMAKE_C11_EXTENSION_COMPILE_OPTION "")

  # There is no meaningful default for this
  set(CMAKE_C_STANDARD_DEFAULT "")

  # There are no C compiler modes so we hard-code the known compiler supported
  # features. Override the default macro for this special case.  Pretend that
  # all language standards are available so that at least compilation
  # can be attempted.
  macro(cmake_record_c_compile_features)
    list(APPEND CMAKE_C_COMPILE_FEATURES
      c_std_90
      c_std_99
      c_std_11
      c_std_17
      c_std_23
      c_function_prototypes
      )
    list(APPEND CMAKE_C90_COMPILE_FEATURES c_std_90 c_function_prototypes)
    list(APPEND CMAKE_C99_COMPILE_FEATURES c_std_99)
    list(APPEND CMAKE_C11_COMPILE_FEATURES c_std_11)
    if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 14.0)
      list(APPEND CMAKE_C_COMPILE_FEATURES c_variadic_macros)
      list(APPEND CMAKE_C99_COMPILE_FEATURES c_variadic_macros)
    endif()
    set(_result 0) # expected by cmake_determine_compile_features
  endmacro()
endif()

set(CMAKE_C_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -TC)


code:
# Reference: https://docs.microsoft.com/en-us/cpp/visual-cpp-language-conformance
# https://blogs.msdn.microsoft.com/vcblog/2015/06/19/c111417-features-in-vs-2015-rtm/
# https://blogs.msdn.microsoft.com/vcblog/2013/12/02/c1114-core-language-features-in-vs-2013-and-the-nov-2013-ctp/
# https://blogs.msdn.microsoft.com/vcblog/2011/09/12/c11-features-in-visual-c-11/

set(_cmake_oldestSupported "_MSC_VER >= 1600")

# VS 2017 v15.3 fixes support for incomplete decltypes
# https://docs.microsoft.com/en-us/cpp/cpp-conformance-improvements-2017#update_153
set(_cmake_feature_test_cxx_decltype_incomplete_return_types "_MSC_VER >= 1911")

# VS 2017 v15.3 fixes support for "N3652 Extended constexpr"
set(_cmake_feature_test_cxx_relaxed_constexpr "_MSC_VER >= 1911")

# VS 2017 Preview introduces support for aggregate initializers.
set(_cmake_feature_test_cxx_aggregate_default_initializers "_MSC_FULL_VER >= 190024406")

# VS 2015 Update 2 introduces support for variable templates.
# https://www.visualstudio.com/en-us/news/vs2015-update2-vs.aspx
set(_cmake_feature_test_cxx_variable_templates "_MSC_FULL_VER >= 190023918")

set(MSVC_2015 "_MSC_VER >= 1900")
set(_cmake_feature_test_cxx_alignas "${MSVC_2015}")
set(_cmake_feature_test_cxx_alignof "${MSVC_2015}")
set(_cmake_feature_test_cxx_attributes "${MSVC_2015}")
set(_cmake_feature_test_cxx_attribute_deprecated "${MSVC_2015}")
set(_cmake_feature_test_cxx_binary_literals "${MSVC_2015}")
set(_cmake_feature_test_cxx_constexpr "${MSVC_2015}")
set(_cmake_feature_test_cxx_decltype_auto "${MSVC_2015}")
set(_cmake_feature_test_cxx_digit_separators "${MSVC_2015}")
set(_cmake_feature_test_cxx_func_identifier "${MSVC_2015}")
set(_cmake_feature_test_cxx_nonstatic_member_init "${MSVC_2015}")
# Microsoft calls this 'rvalue references v3'
set(_cmake_feature_test_cxx_defaulted_move_initializers "${MSVC_2015}")
set(_cmake_feature_test_cxx_generic_lambdas "${MSVC_2015}")
set(_cmake_feature_test_cxx_inheriting_constructors "${MSVC_2015}")
set(_cmake_feature_test_cxx_inline_namespaces "${MSVC_2015}")
set(_cmake_feature_test_cxx_lambda_init_captures "${MSVC_2015}")
set(_cmake_feature_test_cxx_noexcept "${MSVC_2015}")
set(_cmake_feature_test_cxx_return_type_deduction "${MSVC_2015}")
set(_cmake_feature_test_cxx_sizeof_member "${MSVC_2015}")
set(_cmake_feature_test_cxx_thread_local "${MSVC_2015}")
set(_cmake_feature_test_cxx_unicode_literals "${MSVC_2015}")
set(_cmake_feature_test_cxx_unrestricted_unions "${MSVC_2015}")
set(_cmake_feature_test_cxx_user_literals "${MSVC_2015}")
set(_cmake_feature_test_cxx_reference_qualified_functions "${MSVC_2015}")
# "The copies and moves don't interact precisely like the Standard says they
# should. For example, deletion of moves is specified to also suppress
# copies, but Visual C++ in Visual Studio 2013 does not."
# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx
# lists this as 'partial' in 2013
set(_cmake_feature_test_cxx_deleted_functions "${MSVC_2015}")

# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx
# Note 1. While previous version of VisualStudio said they supported these
# they silently produced bad code, and are now marked as having partial
# support in previous versions. The footnote says the support will be complete
# in MSVC 2015, so support the feature for that version, assuming that is true.
# The blog post also says that VS 2013 Update 3 generates an error in cases
# that previously produced bad code.
set(_cmake_feature_test_cxx_generalized_initializers "_MSC_FULL_VER >= 180030723")

set(MSVC_2013 "_MSC_VER >= 1800")
set(_cmake_feature_test_cxx_alias_templates "${MSVC_2013}")
# Microsoft now states they support contextual conversions in 2013 and above.
# See footnote 6 at:
# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx
set(_cmake_feature_test_cxx_contextual_conversions "${MSVC_2013}")
set(_cmake_feature_test_cxx_default_function_template_args "${MSVC_2013}")
set(_cmake_feature_test_cxx_defaulted_functions "${MSVC_2013}")
set(_cmake_feature_test_cxx_delegating_constructors "${MSVC_2013}")
set(_cmake_feature_test_cxx_explicit_conversions "${MSVC_2013}")
set(_cmake_feature_test_cxx_raw_string_literals "${MSVC_2013}")
set(_cmake_feature_test_cxx_uniform_initialization "${MSVC_2013}")
# Support is documented, but possibly partly broken:
# https://msdn.microsoft.com/en-us/library/hh567368.aspx
# http://thread.gmane.org/gmane.comp.lib.boost.devel/244986/focus=245333
set(_cmake_feature_test_cxx_variadic_templates "${MSVC_2013}")

set(MSVC_2012 "_MSC_VER >= 1700")
set(_cmake_feature_test_cxx_enum_forward_declarations "${MSVC_2012}")
set(_cmake_feature_test_cxx_final "${MSVC_2012}")
set(_cmake_feature_test_cxx_range_for "${MSVC_2012}")
set(_cmake_feature_test_cxx_strong_enums "${MSVC_2012}")

set(MSVC_2010 "_MSC_VER >= 1600")
set(_cmake_feature_test_cxx_auto_type "${MSVC_2010}")
set(_cmake_feature_test_cxx_decltype "${MSVC_2010}")
set(_cmake_feature_test_cxx_extended_friend_declarations "${MSVC_2010}")
set(_cmake_feature_test_cxx_extern_templates "${MSVC_2010}")
set(_cmake_feature_test_cxx_lambdas "${MSVC_2010}")
set(_cmake_feature_test_cxx_local_type_template_args "${MSVC_2010}")
set(_cmake_feature_test_cxx_long_long_type "${MSVC_2010}")
set(_cmake_feature_test_cxx_nullptr "${MSVC_2010}")
set(_cmake_feature_test_cxx_override "${MSVC_2010}")
set(_cmake_feature_test_cxx_right_angle_brackets "${MSVC_2010}")
set(_cmake_feature_test_cxx_rvalue_references "${MSVC_2010}")
set(_cmake_feature_test_cxx_static_assert "${MSVC_2010}")
set(_cmake_feature_test_cxx_template_template_parameters "${MSVC_2010}")
set(_cmake_feature_test_cxx_trailing_return_types "${MSVC_2010}")
set(_cmake_feature_test_cxx_variadic_macros "${MSVC_2010}")

# Unset all the variables that we don't need exposed.
# _cmake_oldestSupported is required by WriteCompilerDetectionHeader
set(MSVC_2017)
set(MSVC_2015)
set(MSVC_2013)
set(MSVC_2012)
set(MSVC_2010)


code:
# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.

include(Compiler/MSVC)
__compiler_msvc(CXX)

include(Compiler/CMakeCommonCompilerMacros)

if ((CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.0.24215.1 AND
     CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.10) OR
   CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.10.25017)

  # VS 2015 Update 3 and above support language standard level flags,
  # with the default and minimum level being C++14.
  set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "")
  set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "")
  set(CMAKE_CXX98_STANDARD__HAS_FULL_SUPPORT ON)
  set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "")
  set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "")
  set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "-std:c++14")
  set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "-std:c++14")

  if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.11.25505)
    set(CMAKE_CXX11_STANDARD__HAS_FULL_SUPPORT ON)
    set(CMAKE_CXX14_STANDARD__HAS_FULL_SUPPORT ON)
    set(CMAKE_CXX17_STANDARD_COMPILE_OPTION "-std:c++17")
    set(CMAKE_CXX17_EXTENSION_COMPILE_OPTION "-std:c++17")
  else()
    set(CMAKE_CXX17_STANDARD_COMPILE_OPTION "-std:c++latest")
    set(CMAKE_CXX17_EXTENSION_COMPILE_OPTION "-std:c++latest")
  endif()

  if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.29.30129)
    set(CMAKE_CXX20_STANDARD_COMPILE_OPTION "-std:c++20")
    set(CMAKE_CXX20_EXTENSION_COMPILE_OPTION "-std:c++20")
    set(CMAKE_CXX23_STANDARD_COMPILE_OPTION "-std:c++latest")
    set(CMAKE_CXX23_EXTENSION_COMPILE_OPTION "-std:c++latest")
  elseif(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.12.25835)
    set(CMAKE_CXX20_STANDARD_COMPILE_OPTION "-std:c++latest")
    set(CMAKE_CXX20_EXTENSION_COMPILE_OPTION "-std:c++latest")
  endif()

  __compiler_check_default_language_standard(CXX 19.0 14)

elseif (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 16.0)
  # MSVC has no specific options to set language standards, but set them as
  # empty strings anyways so the feature test infrastructure can at least check
  # to see if they are defined.
  set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "")
  set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "")
  set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "")
  set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "")
  set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "")
  set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "")
  set(CMAKE_CXX17_STANDARD_COMPILE_OPTION "")
  set(CMAKE_CXX17_EXTENSION_COMPILE_OPTION "")
  set(CMAKE_CXX20_STANDARD_COMPILE_OPTION "")
  set(CMAKE_CXX20_EXTENSION_COMPILE_OPTION "")

  # There is no meaningful default for this
  set(CMAKE_CXX_STANDARD_DEFAULT "")

  # There are no compiler modes so we only need to test features once.
  # Override the default macro for this special case.  Pretend that
  # all language standards are available so that at least compilation
  # can be attempted.
  macro(cmake_record_cxx_compile_features)
    list(APPEND CMAKE_CXX_COMPILE_FEATURES
      cxx_std_98
      cxx_std_11
      cxx_std_14
      cxx_std_17
      cxx_std_20
      cxx_std_23
      cxx_std_26
      )
    _record_compiler_features(CXX "" CMAKE_CXX_COMPILE_FEATURES)
  endmacro()
endif()

if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "19.34")
  string(CONCAT CMAKE_CXX_SCANDEP_SOURCE
    "<CMAKE_CXX_COMPILER> <DEFINES> <INCLUDES> <FLAGS> <SOURCE> -nologo -TP"
    " -showIncludes"
    " -scanDependencies <DYNDEP_FILE>"
    " -Fo<OBJECT>")
  set(CMAKE_CXX_SCANDEP_DEPFILE_FORMAT "msvc")
  set(CMAKE_CXX_MODULE_MAP_FORMAT "msvc")
  set(CMAKE_CXX_MODULE_MAP_FLAG "@<MODULE_MAP_FILE>")
  set(CMAKE_CXX_MODULE_BMI_ONLY_FLAG "-ifcOnly;-ifcOutput;<OBJECT>")
endif ()


code:
set(_compiler_id_pp_test "defined(_MSC_VER)")

set(_compiler_id_version_compute "
  /* _MSC_VER = VVRR */
# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(_MSC_VER / 100)
# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(_MSC_VER % 100)
# if defined(_MSC_FULL_VER)
#  if _MSC_VER >= 1400
    /* _MSC_FULL_VER = VVRRPPPPP */
#   define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(_MSC_FULL_VER % 100000)
#  else
    /* _MSC_FULL_VER = VVRRPPPP */
#   define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(_MSC_FULL_VER % 10000)
#  endif
# endif
# if defined(_MSC_BUILD)
#  define @PREFIX@COMPILER_VERSION_TWEAK @MACRO_DEC@(_MSC_BUILD)
# endif")


code:
# 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_MSVC)
  return()
endif()
set(__COMPILER_MSVC 1)

macro(__compiler_msvc lang)
  set(CMAKE_${lang}_CLANG_TIDY_DRIVER_MODE "cl")
  set(CMAKE_${lang}_INCLUDE_WHAT_YOU_USE_DRIVER_MODE "cl")
  set(CMAKE_${lang}_COMPILE_OPTIONS_WARNING_AS_ERROR "-WX")

  # /JMC "Just My Code" is only supported by MSVC 19.05 onward.
  if (CMAKE_${lang}_COMPILER_VERSION VERSION_GREATER_EQUAL 19.05)
    set(CMAKE_${lang}_COMPILE_OPTIONS_JMC "-JMC")
  endif()

  # The `/external:I` flag was made non-experimental in 19.29.30036.3.
  if (CMAKE_${lang}_COMPILER_VERSION VERSION_GREATER_EQUAL 19.29.30036.3)
    set(CMAKE_INCLUDE_SYSTEM_FLAG_${lang} "-external:I")
    set(_CMAKE_INCLUDE_SYSTEM_FLAG_${lang}_WARNING "-external:W0 ")
  endif ()
endmacro()


code:
# Help CMAKE_PARSE_IMPLICIT_LINK_INFO detect NAG Fortran object files.
if(NOT CMAKE_Fortran_COMPILER_WORKS AND NOT CMAKE_Fortran_COMPILER_FORCED)
  message(CHECK_START "Detecting NAG Fortran directory")
  # Run with -dryrun to see sample "link" line.
  execute_process(
    COMMAND ${CMAKE_Fortran_COMPILER} dummy.o -dryrun
    OUTPUT_VARIABLE _dryrun
    ERROR_VARIABLE _dryrun
    )
  # Match an object file.
  string(REGEX MATCH "/[^ ]*/[^ /][^ /]*\\.o" _nag_obj "${_dryrun}")
  if(_nag_obj)
    # Parse object directory and convert to a regex.
    string(REGEX REPLACE "/[^/]*$" "" _nag_dir "${_nag_obj}")
    string(REGEX REPLACE "([][+.*()^])" "\\\\\\1" _nag_regex "${_nag_dir}")
    set(CMAKE_Fortran_IMPLICIT_OBJECT_REGEX "^${_nag_regex}/")
    message(CONFIGURE_LOG
      "Detecting NAG Fortran directory with -dryrun found\n"
      "  object: ${_nag_obj}\n"
      "  directory: ${_nag_dir}\n"
      "  regex: ${CMAKE_Fortran_IMPLICIT_OBJECT_REGEX}\n"
      "from output:\n${_dryrun}\n\n")
    message(CHECK_PASS "${_nag_dir}")
  else()
    message(CONFIGURE_LOG
      "Detecting NAG Fortran directory with -dryrun failed:\n${_dryrun}\n\n")
    message(CHECK_FAIL "failed")
  endif()
endif()

set(CMAKE_Fortran_SUBMODULE_SEP ".")
set(CMAKE_Fortran_SUBMODULE_EXT ".sub")
set(CMAKE_Fortran_MODDIR_FLAG "-mdir ")
set(CMAKE_Fortran_MODDIR_INCLUDE_FLAG "-I") # -mdir does not affect search path
set(CMAKE_SHARED_LIBRARY_Fortran_FLAGS "-PIC")
set(CMAKE_Fortran_FORMAT_FIXED_FLAG "-fixed")
set(CMAKE_Fortran_FORMAT_FREE_FLAG "-free")
set(CMAKE_Fortran_COMPILE_OPTIONS_PIC "-PIC")
set(CMAKE_Fortran_COMPILE_OPTIONS_PIE "-PIC")
set(CMAKE_Fortran_RESPONSE_FILE_LINK_FLAG "-Wl,@")
set(CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_ON "-fpp")


code:
include(Compiler/PGI-C)
include(Compiler/NVHPC)

# Needed so that we support `LANGUAGE` property correctly
set(CMAKE_C_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c)

if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 20.11)
  set(CMAKE_C17_STANDARD_COMPILE_OPTION  -std=c17)
  set(CMAKE_C17_EXTENSION_COMPILE_OPTION -std=gnu17)
endif()

if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 21.07)
  set(CMAKE_DEPFILE_FLAGS_C "-MD -MT <DEP_TARGET> -MF <DEP_FILE>")
  set(CMAKE_C_DEPFILE_FORMAT gcc)
  set(CMAKE_C_DEPENDS_USE_COMPILER TRUE)
else()
  # Before NVHPC 21.07 the `-MD` flag implicitly
  # implies `-E` and therefore compilation and dependency generation
  # can't occur in the same invocation
  set(CMAKE_C_DEPENDS_EXTRA_COMMANDS "<CMAKE_C_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -x c -M <SOURCE> -MT <OBJECT> -MD<DEP_FILE>")
endif()

__compiler_nvhpc(C)


code:
include(Compiler/PGI-CXX)
include(Compiler/NVHPC)

# Needed so that we support `LANGUAGE` property correctly
set(CMAKE_CXX_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c++)

if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 20.11)
  set(CMAKE_CXX20_STANDARD_COMPILE_OPTION  -std=c++20)
  set(CMAKE_CXX20_EXTENSION_COMPILE_OPTION -std=gnu++20)
endif()

if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 21.07)
  set(CMAKE_DEPFILE_FLAGS_CXX "-MD -MT <DEP_TARGET> -MF <DEP_FILE>")
  set(CMAKE_CXX_DEPFILE_FORMAT gcc)
  set(CMAKE_CXX_DEPENDS_USE_COMPILER TRUE)
else()
  # Before NVHPC 21.07 the `-MD` flag implicitly
  # implies `-E` and therefore compilation and dependency generation
  # can't occur in the same invocation
  set(CMAKE_CXX_DEPENDS_EXTRA_COMMANDS "<CMAKE_CXX_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -x c++ -M <SOURCE> -MT <OBJECT> -MD<DEP_FILE>")
endif()
__compiler_nvhpc(CXX)


code:
set(_compiler_id_pp_test "defined(__NVCOMPILER)")

set(_compiler_id_version_compute "
# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__NVCOMPILER_MAJOR__)
# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(__NVCOMPILER_MINOR__)
# if defined(__NVCOMPILER_PATCHLEVEL__)
#  define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__NVCOMPILER_PATCHLEVEL__)
# endif")


code:
include(Compiler/PGI-Fortran)
include(Compiler/NVHPC)
__compiler_nvhpc(Fortran)
if(CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 21.7)
  # Before NVHPC 21.7 nvfortran didn't support isystem
  unset(CMAKE_INCLUDE_SYSTEM_FLAG_Fortran)
endif()


code:
# 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_NVHPC)
  return()
endif()
set(__COMPILER_NVHPC 1)

include(Compiler/PGI)

macro(__compiler_nvhpc lang)
  # Logic specific to NVHPC.
  set(CMAKE_INCLUDE_SYSTEM_FLAG_${lang} "-isystem ")
  set(CMAKE_${lang}_COMPILE_OPTIONS_WARNING_AS_ERROR "-Werror")
endmacro()


code:
include(Compiler/NVIDIA)
__compiler_nvidia_cxx_standards(CUDA)
__compiler_nvidia_cuda_flags(CUDA)

set(CMAKE_CUDA_COMPILER_HAS_DEVICE_LINK_PHASE True)

set(_CMAKE_CUDA_WHOLE_FLAG "-c")
set(_CMAKE_CUDA_RDC_FLAG "-rdc=true")
set(_CMAKE_CUDA_PTX_FLAG "-ptx")
set(_CMAKE_CUDA_CUBIN_FLAG "-cubin")
set(_CMAKE_CUDA_FATBIN_FLAG "-fatbin")
if(CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL "11.7.0")
  set(_CMAKE_CUDA_OPTIX_FLAG "-optix-ir")
endif()

if(CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 11.2)
  set(CMAKE_CUDA_DEVICE_LINK_OPTIONS_IPO " -dlto")
endif()

set(CMAKE_CUDA_DEVICE_COMPILER_WRAPPER_FLAG "-Xcompiler=")
set(CMAKE_CUDA_DEVICE_COMPILER_WRAPPER_FLAG_SEP ",")
set(CMAKE_CUDA_DEVICE_LINKER_WRAPPER_FLAG "-Xlinker=")
set(CMAKE_CUDA_DEVICE_LINKER_WRAPPER_FLAG_SEP ",")


code:
set(_compiler_id_pp_test "defined(__NVCC__)")

set(_compiler_id_version_compute "
# if defined(__CUDACC_VER_MAJOR__)
#  define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__CUDACC_VER_MAJOR__)
#  define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(__CUDACC_VER_MINOR__)
#  define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__CUDACC_VER_BUILD__)
# endif
# if defined(_MSC_VER)
   /* _MSC_VER = VVRR */
#  define @PREFIX@SIMULATE_VERSION_MAJOR @MACRO_DEC@(_MSC_VER / 100)
#  define @PREFIX@SIMULATE_VERSION_MINOR @MACRO_DEC@(_MSC_VER % 100)
# elif defined(__clang__)
#  define @PREFIX@SIMULATE_VERSION_MAJOR @MACRO_DEC@(__clang_major__)
#  define @PREFIX@SIMULATE_VERSION_MINOR @MACRO_DEC@(__clang_minor__)
# elif defined(__GNUC__)
#  define @PREFIX@SIMULATE_VERSION_MAJOR @MACRO_DEC@(__GNUC__)
#  define @PREFIX@SIMULATE_VERSION_MINOR @MACRO_DEC@(__GNUC_MINOR__)
# endif")

set(_compiler_id_simulate "
# if defined(_MSC_VER)
#  define @PREFIX@SIMULATE_ID \"MSVC\"
# elif defined(__clang__)
#  define @PREFIX@SIMULATE_ID \"Clang\"
# elif defined(__GNUC__)
#  define @PREFIX@SIMULATE_ID \"GNU\"
# endif")


code:
include(Compiler/NVIDIA)
__compiler_nvidia_cxx_standards(HIP)
__compiler_nvidia_cuda_flags(HIP)

# The ROCm hip-lang cmake package's device runtime library is not needed for NVIDIA GPUs.
set(_CMAKE_HIP_DEVICE_RUNTIME_TARGET "")

set(CMAKE_HIP_STANDARD_INCLUDE_DIRECTORIES "${CMAKE_HIP_COMPILER_ROCM_ROOT}/include")

set(CMAKE_HIP_LINK_EXECUTABLE
  "<CMAKE_HIP_HOST_LINK_LAUNCHER> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>${__IMPLICIT_LINKS}")
set(CMAKE_HIP_CREATE_SHARED_LIBRARY
  "<CMAKE_HIP_HOST_LINK_LAUNCHER> <CMAKE_SHARED_LIBRARY_HIP_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_HIP_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>${__IMPLICIT_LINKS}")
set(CMAKE_HIP_CREATE_SHARED_MODULE "${CMAKE_HIP_CREATE_SHARED_LIBRARY}")


code:
# This module is shared by multiple languages; use include blocker.
if(__COMPILER_NVIDIA)
  return()
endif()
set(__COMPILER_NVIDIA 1)

include(Compiler/CMakeCommonCompilerMacros)

macro(__compiler_nvidia_cxx_standards lang)
  if("x${CMAKE_${lang}_SIMULATE_ID}" STREQUAL "xMSVC")
    # MSVC requires c++14 as the minimum level
    set(CMAKE_${lang}03_STANDARD_COMPILE_OPTION "")
    set(CMAKE_${lang}03_EXTENSION_COMPILE_OPTION "")

    # MSVC requires c++14 as the minimum level
    set(CMAKE_${lang}11_STANDARD_COMPILE_OPTION "")
    set(CMAKE_${lang}11_EXTENSION_COMPILE_OPTION "")

    if (NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 9.0)
      if(CMAKE_${lang}_SIMULATE_VERSION VERSION_GREATER_EQUAL 19.10.25017)
        set(CMAKE_${lang}14_STANDARD_COMPILE_OPTION "-std=c++14")
        set(CMAKE_${lang}14_EXTENSION_COMPILE_OPTION "-std=c++14")
      else()
        set(CMAKE_${lang}14_STANDARD_COMPILE_OPTION "")
        set(CMAKE_${lang}14_EXTENSION_COMPILE_OPTION "")
      endif()
    endif()

    if (NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 11.0)
      if(CMAKE_${lang}_SIMULATE_VERSION VERSION_GREATER_EQUAL 19.11.25505)
        set(CMAKE_${lang}17_STANDARD_COMPILE_OPTION "-std=c++17")
        set(CMAKE_${lang}17_EXTENSION_COMPILE_OPTION "-std=c++17")
      endif()
    endif()

    if (NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 12.0)
      if(CMAKE_${lang}_SIMULATE_VERSION VERSION_GREATER_EQUAL 19.11.25505)
        set(CMAKE_${lang}20_STANDARD_COMPILE_OPTION "-std=c++20")
        set(CMAKE_${lang}20_EXTENSION_COMPILE_OPTION "-std=c++20")
      endif()
    endif()
  else()
    set(CMAKE_${lang}03_STANDARD_COMPILE_OPTION "")
    set(CMAKE_${lang}03_EXTENSION_COMPILE_OPTION "")

    set(CMAKE_${lang}11_STANDARD_COMPILE_OPTION "-std=c++11")
    set(CMAKE_${lang}11_EXTENSION_COMPILE_OPTION "-std=c++11")

    if (NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 9.0)
      set(CMAKE_${lang}03_STANDARD_COMPILE_OPTION "-std=c++03")
      set(CMAKE_${lang}03_EXTENSION_COMPILE_OPTION "-std=c++03")
      set(CMAKE_${lang}14_STANDARD_COMPILE_OPTION "-std=c++14")
      set(CMAKE_${lang}14_EXTENSION_COMPILE_OPTION "-std=c++14")
    endif()

    if (NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 11.0)
      set(CMAKE_${lang}17_STANDARD_COMPILE_OPTION "-std=c++17")
      set(CMAKE_${lang}17_EXTENSION_COMPILE_OPTION "-std=c++17")
    endif()

    if (NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 12.0)
      set(CMAKE_${lang}20_STANDARD_COMPILE_OPTION "-std=c++20")
      set(CMAKE_${lang}20_EXTENSION_COMPILE_OPTION "-std=c++20")
    endif()
  endif()

  __compiler_check_default_language_standard(${lang} 6.0 03)
endmacro()

macro(__compiler_nvidia_cuda_flags lang)
  set(CMAKE_${lang}_VERBOSE_FLAG "-v")
  set(CMAKE_${lang}_VERBOSE_COMPILE_FLAG "-Xcompiler=-v")
  set(_CMAKE_COMPILE_AS_${lang}_FLAG "-x cu")

  if (CMAKE_${lang}_COMPILER_VERSION VERSION_GREATER_EQUAL 10.2.89)
    # The -forward-unknown-to-host-compiler flag was only
    # added to nvcc in 10.2 so before that we had no good
    # way to invoke the NVCC compiler and propagate unknown
    # flags such as -pthread to the host compiler
    set(_CMAKE_${lang}_EXTRA_FLAGS "-forward-unknown-to-host-compiler")
  else()
    set(_CMAKE_${lang}_EXTRA_FLAGS "")
  endif()

  if(CMAKE_${lang}_COMPILER_VERSION VERSION_GREATER_EQUAL "8.0.0")
    set(_CMAKE_${lang}_EXTRA_DEVICE_LINK_FLAGS "-Wno-deprecated-gpu-targets")
  else()
    set(_CMAKE_${lang}_EXTRA_DEVICE_LINK_FLAGS "")
  endif()

  if(CMAKE_${lang}_HOST_COMPILER AND NOT CMAKE_GENERATOR MATCHES "Visual Studio")
    string(APPEND _CMAKE_${lang}_EXTRA_FLAGS " -ccbin=<CMAKE_${lang}_HOST_COMPILER>")
  endif()

  if (CMAKE_${lang}_COMPILER_VERSION VERSION_GREATER_EQUAL 10.2.89)
    # Starting in 10.2, nvcc supported treating all warnings as errors
    set(CMAKE_${lang}_COMPILE_OPTIONS_WARNING_AS_ERROR "-Werror" "all-warnings")
  endif()

  set(CMAKE_${lang}_DEPFILE_FORMAT gcc)
  if((NOT DEFINED CMAKE_DEPENDS_USE_COMPILER OR CMAKE_DEPENDS_USE_COMPILER)
      AND CMAKE_GENERATOR MATCHES "Makefiles|WMake")
    set(CMAKE_${lang}_DEPENDS_USE_COMPILER TRUE)
  endif()

  if (CMAKE_${lang}_COMPILER_VERSION VERSION_GREATER_EQUAL 10.2.89)
    # The -MD flag was only added to nvcc in 10.2 so
    # before that we had to invoke the compiler twice
    # to get header dependency information
    set(CMAKE_DEPFILE_FLAGS_${lang} "-MD -MT <DEP_TARGET> -MF <DEP_FILE>")
  else()
    set(CMAKE_${lang}_DEPENDS_EXTRA_COMMANDS "<CMAKE_${lang}_COMPILER> ${_CMAKE_${lang}_EXTRA_FLAGS} <DEFINES> <INCLUDES> <FLAGS> ${_CMAKE_COMPILE_AS_${lang}_FLAG} -M <SOURCE> -MT <OBJECT> -o <DEP_FILE>")
  endif()

  if(CMAKE_${lang}_COMPILER_VERSION VERSION_GREATER_EQUAL 11.2)
    set(_CMAKE_${lang}_IPO_SUPPORTED_BY_CMAKE YES)
    set(_CMAKE_${lang}_IPO_MAY_BE_SUPPORTED_BY_COMPILER YES)
  endif()

  if(NOT "x${CMAKE_${lang}_SIMULATE_ID}" STREQUAL "xMSVC")
    set(CMAKE_${lang}_COMPILE_OPTIONS_PIE -Xcompiler=-fPIE)
    set(CMAKE_${lang}_COMPILE_OPTIONS_PIC -Xcompiler=-fPIC)
    set(CMAKE_${lang}_COMPILE_OPTIONS_VISIBILITY -Xcompiler=-fvisibility=)
    # CMAKE_SHARED_LIBRARY_${lang}_FLAGS is sent to the host linker so we
    # don't need to forward it through nvcc.
    set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS -fPIC)
    string(APPEND CMAKE_${lang}_FLAGS_INIT " ")
    string(APPEND CMAKE_${lang}_FLAGS_DEBUG_INIT " -g")
    string(APPEND CMAKE_${lang}_FLAGS_RELEASE_INIT " -O3 -DNDEBUG")
    string(APPEND CMAKE_${lang}_FLAGS_MINSIZEREL_INIT " -O1 -DNDEBUG")
    string(APPEND CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT " -O2 -g -DNDEBUG")
  endif()

  set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS -shared)
  set(CMAKE_INCLUDE_SYSTEM_FLAG_${lang} "-isystem ")

  if (CMAKE_${lang}_SIMULATE_ID STREQUAL "GNU")
    set(CMAKE_${lang}_LINKER_WRAPPER_FLAG "-Wl,")
    set(CMAKE_${lang}_LINKER_WRAPPER_FLAG_SEP ",")
  elseif(CMAKE_${lang}_SIMULATE_ID STREQUAL "Clang")
    set(CMAKE_${lang}_LINKER_WRAPPER_FLAG "-Xlinker" " ")
    set(CMAKE_${lang}_LINKER_WRAPPER_FLAG_SEP)
  endif()

  set(CMAKE_${lang}_RUNTIME_LIBRARY_LINK_OPTIONS_STATIC  "cudadevrt;cudart_static")
  set(CMAKE_${lang}_RUNTIME_LIBRARY_LINK_OPTIONS_SHARED  "cudadevrt;cudart")
  set(CMAKE_${lang}_RUNTIME_LIBRARY_LINK_OPTIONS_NONE    "")

  if(UNIX AND NOT (CMAKE_SYSTEM_NAME STREQUAL "QNX"))
    list(APPEND CMAKE_${lang}_RUNTIME_LIBRARY_LINK_OPTIONS_STATIC "rt" "pthread" "dl")
  endif()

  if (CMAKE_${lang}_COMPILER_VERSION VERSION_GREATER_EQUAL "9.0")
    set(CMAKE_${lang}_RESPONSE_FILE_DEVICE_LINK_FLAG "--options-file ")
    set(CMAKE_${lang}_RESPONSE_FILE_FLAG "--options-file ")
  endif()

  if (CMAKE_${lang}_COMPILER_VERSION VERSION_GREATER_EQUAL "11.0")
    set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_INCLUDES 1)
    set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_LIBRARIES 1)
    set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_OBJECTS 1)
  else()
    set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_INCLUDES 0)
    set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_LIBRARIES 0)
    set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_OBJECTS 0)
  endif()
endmacro()


code: include(Compiler/OpenWatcom)


code:
set(_compiler_id_pp_test "defined(__WATCOMC__)")

set(_compiler_id_version_compute "
   /* __WATCOMC__ = VVRP + 1100 */
# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@((__WATCOMC__ - 1100) / 100)
# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@((__WATCOMC__ / 10) % 10)
# if (__WATCOMC__ % 10) > 0
#  define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__WATCOMC__ % 10)
# endif")


code:
# 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.
include_guard()

set(CMAKE_LIBRARY_PATH_FLAG "libpath ")
set(CMAKE_LINK_LIBRARY_FLAG "library ")
set(CMAKE_LINK_LIBRARY_FILE_FLAG "library ")
set(CMAKE_LINK_OBJECT_FILE_FLAG "file ")

if(CMAKE_VERBOSE_MAKEFILE)
  set(CMAKE_WCL_QUIET)
  set(CMAKE_WLINK_QUIET)
  set(CMAKE_LIB_QUIET)
else()
  set(CMAKE_WCL_QUIET "-zq")
  set(CMAKE_WLINK_QUIET "option quiet")
  set(CMAKE_LIB_QUIET "-q")
endif()

foreach(type CREATE_SHARED_LIBRARY CREATE_SHARED_MODULE LINK_EXECUTABLE)
  set(CMAKE_C_${type}_USE_WATCOM_QUOTE 1)
  set(CMAKE_CXX_${type}_USE_WATCOM_QUOTE 1)
endforeach()

foreach(type SHARED MODULE EXE)
  # linker map file creation directives
  string(APPEND CMAKE_${type}_LINKER_FLAGS_INIT " opt map")
  # linker debug directives
  string(APPEND CMAKE_${type}_LINKER_FLAGS_DEBUG_INIT " debug all")
  string(APPEND CMAKE_${type}_LINKER_FLAGS_RELWITHDEBINFO_INIT " debug all")
endforeach()

foreach(lang C CXX)
  # warning level
  string(APPEND CMAKE_${lang}_FLAGS_INIT " -w3")
  # debug options
  string(APPEND CMAKE_${lang}_FLAGS_DEBUG_INIT " -d2")
  string(APPEND CMAKE_${lang}_FLAGS_MINSIZEREL_INIT " -s -os -d0 -dNDEBUG")
  string(APPEND CMAKE_${lang}_FLAGS_RELEASE_INIT " -s -ot -d0 -dNDEBUG")
  string(APPEND CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT " -s -ot -d1 -dNDEBUG")
endforeach()

# C create import library
set(CMAKE_C_CREATE_IMPORT_LIBRARY
  "<CMAKE_AR> -c -q -n -b <TARGET_IMPLIB> +<TARGET_QUOTED>")
# C++ create import library
set(CMAKE_CXX_CREATE_IMPORT_LIBRARY ${CMAKE_C_CREATE_IMPORT_LIBRARY})

# C link a object files into an executable file
set(CMAKE_C_LINK_EXECUTABLE
  "<CMAKE_LINKER> ${CMAKE_WLINK_QUIET} name <TARGET> <LINK_FLAGS> file {<OBJECTS>} <LINK_LIBRARIES>")
# C++ link a object files into an executable file
set(CMAKE_CXX_LINK_EXECUTABLE ${CMAKE_C_LINK_EXECUTABLE})

# C compile a file into an object file
set(CMAKE_C_COMPILE_OBJECT
  "<CMAKE_C_COMPILER> ${CMAKE_WCL_QUIET} -d+ <DEFINES> <INCLUDES> <FLAGS> -fo<OBJECT> -c -cc <SOURCE>")
# C++ compile a file into an object file
set(CMAKE_CXX_COMPILE_OBJECT
  "<CMAKE_CXX_COMPILER> ${CMAKE_WCL_QUIET} -d+ <DEFINES> <INCLUDES> <FLAGS> -fo<OBJECT> -c -cc++ <SOURCE>")

# C preprocess a source file
set(CMAKE_C_CREATE_PREPROCESSED_SOURCE
  "<CMAKE_C_COMPILER> ${CMAKE_WCL_QUIET} -d+ <DEFINES> <INCLUDES> <FLAGS> -fo<PREPROCESSED_SOURCE> -pl -cc <SOURCE>")
# C++ preprocess a source file
set(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE
  "<CMAKE_CXX_COMPILER> ${CMAKE_WCL_QUIET} -d+ <DEFINES> <INCLUDES> <FLAGS> -fo<PREPROCESSED_SOURCE> -pl -cc++ <SOURCE>")

# C create a shared library
set(CMAKE_C_CREATE_SHARED_LIBRARY
  "<CMAKE_LINKER> ${CMAKE_WLINK_QUIET} name <TARGET> <LINK_FLAGS> option implib=<TARGET_IMPLIB> file {<OBJECTS>} <LINK_LIBRARIES>")
# C++ create a shared library
set(CMAKE_CXX_CREATE_SHARED_LIBRARY ${CMAKE_C_CREATE_SHARED_LIBRARY})

# C create a shared module
set(CMAKE_C_CREATE_SHARED_MODULE
  "<CMAKE_LINKER> ${CMAKE_WLINK_QUIET} name <TARGET> <LINK_FLAGS> file {<OBJECTS>} <LINK_LIBRARIES>")
# C++ create a shared module
set(CMAKE_CXX_CREATE_SHARED_MODULE ${CMAKE_C_CREATE_SHARED_MODULE})

# C create a static library
set(CMAKE_C_CREATE_STATIC_LIBRARY
  "<CMAKE_AR> ${CMAKE_LIB_QUIET} -c -n -b <TARGET_QUOTED> <LINK_FLAGS> <OBJECTS> ")
# C++ create a static library
set(CMAKE_CXX_CREATE_STATIC_LIBRARY ${CMAKE_C_CREATE_STATIC_LIBRARY})

# old CMake internally used OpenWatcom version macros
# for backward compatibility
if(NOT _CMAKE_WATCOM_VERSION)
  set(_CMAKE_WATCOM_VERSION 1)
  if(CMAKE_C_COMPILER_VERSION)
    set(_compiler_version ${CMAKE_C_COMPILER_VERSION})
    set(_compiler_id ${CMAKE_C_COMPILER_ID})
  else()
    set(_compiler_version ${CMAKE_CXX_COMPILER_VERSION})
    set(_compiler_id ${CMAKE_CXX_COMPILER_ID})
  endif()
  set(WATCOM16)
  set(WATCOM17)
  set(WATCOM18)
  set(WATCOM19)
  if("${_compiler_id}" STREQUAL "OpenWatcom")
    if("${_compiler_version}" VERSION_LESS 1.7)
      set(WATCOM16 1)
    endif()
    if("${_compiler_version}" VERSION_EQUAL 1.7)
      set(WATCOM17 1)
    endif()
    if("${_compiler_version}" VERSION_EQUAL 1.8)
      set(WATCOM18 1)
    endif()
    if("${_compiler_version}" VERSION_EQUAL 1.9)
      set(WATCOM19 1)
    endif()
  endif()
endif()


code:
include(Compiler/OrangeC)
__compiler_orangec(ASM)

set(CMAKE_ASM_OUTPUT_EXTENSION ".o")
set(CMAKE_ASM_VERBOSE_FLAG "-yyyyy")

set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s;S;asm;nas)


code:
include(Compiler/OrangeC)
include(Compiler/CMakeCommonCompilerMacros)

set(CMAKE_C_OUTPUT_EXTENSION ".o")
set(CMAKE_C_VERBOSE_FLAG "-yyyyy")
set(CMAKE_C_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c)

set(CMAKE_C90_STANDARD_COMPILE_OPTION -std=c89)
set(CMAKE_C90_EXTENSION_COMPILE_OPTION -std=c89)
set(CMAKE_C90_STANDARD__HAS_FULL_SUPPORT ON)
set(CMAKE_C99_STANDARD_COMPILE_OPTION -std=c99)
set(CMAKE_C99_EXTENSION_COMPILE_OPTION -std=c99)
set(CMAKE_C99_STANDARD__HAS_FULL_SUPPORT ON)
set(CMAKE_C11_STANDARD_COMPILE_OPTION -std=c11)
set(CMAKE_C11_EXTENSION_COMPILE_OPTION -std=c11)
set(CMAKE_C11_STANDARD__HAS_FULL_SUPPORT ON)

__compiler_orangec(C)
#- 6.38 is the earliest version which version info is available in the preprocessor
__compiler_check_default_language_standard(C 6.38 11)


code:
include(Compiler/OrangeC)
include(Compiler/CMakeCommonCompilerMacros)

set(_ORANGEC_COMPILE_CXX " -x c++")
set(CMAKE_CXX_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c++)

set(CMAKE_CXX_OUTPUT_EXTENSION ".o")
set(CMAKE_CXX_VERBOSE_FLAG "-yyyyy")

#- OrangeC is a little lax when accepting compiler version specifications.
#  Usually changing the version only changes the value of __cplusplus.
#  Also we don't support CXX98
set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++11")
set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=c++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=c++14")
set(CMAKE_CXX14_STANDARD__HAS_FULL_SUPPORT ON)

__compiler_orangec(CXX)
#- 6.38 is the earliest version which version info is available in the preprocessor
__compiler_check_default_language_standard(CXX 6.38 14)


code:
set(_compiler_id_pp_test "defined(__ORANGEC__)")

set(_compiler_id_version_compute "
# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__ORANGEC_MAJOR__)
# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(__ORANGEC_MINOR__)
# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__ORANGEC_PATCHLEVEL__)")


code:
include_guard()

macro(__compiler_orangec lang)
  if ("x${lang}" MATCHES "^x(C|CXX)$")
    set(CMAKE_${lang}_CREATE_PREPROCESSED_SOURCE "<CMAKE_${lang}_COMPILER> ${_ORANGEC_COMPILE_${lang}} -! <SOURCE> <DEFINES> <INCLUDES> <FLAGS> +i -o <PREPROCESSED_SOURCE>")
    set(CMAKE_${lang}_CREATE_ASSEMBLY_SOURCE     "<CMAKE_${lang}_COMPILER> ${_ORANGEC_COMPILE_${lang}} -! <SOURCE> <DEFINES> <INCLUDES> <FLAGS> -S -o <ASSEMBLY_SOURCE>")
  endif()
  set(CMAKE_${lang}_COMPILE_OBJECT             "<CMAKE_${lang}_COMPILER> ${_ORANGEC_COMPILE_${lang}} -! -c <SOURCE> <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT>")
  unset(_ORANGEC_COMPILE_${lang})

  set(CMAKE_DEPFILE_FLAGS_${lang} "-MD -MT <DEP_TARGET> -MF <DEP_FILE>")
  set(CMAKE_${lang}_DEPFILE_FORMAT gcc)
  set(CMAKE_${lang}_DEPENDS_USE_COMPILER TRUE)

  string(APPEND CMAKE_${lang}_FLAGS_INIT " ")
  string(APPEND CMAKE_${lang}_FLAGS_DEBUG_INIT " -g")
  string(APPEND CMAKE_${lang}_FLAGS_RELEASE_INIT " -O2 -DNDEBUG")
  string(APPEND CMAKE_${lang}_FLAGS_MINSIZEREL_INIT " -O1 -DNDEBUG")
  string(APPEND CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT " -O2 -g -DNDEBUG")

  set(CMAKE_${lang}_CREATE_STATIC_LIBRARY
    "<CMAKE_${lang}_COMPILER> -! -static -o <TARGET> <LINK_FLAGS> <OBJECTS> ")
  set(CMAKE_${lang}_LINK_EXECUTABLE "<CMAKE_${lang}_COMPILER> -! <FLAGS> -o <TARGET> --out-implib <TARGET_IMPLIB> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> <LINK_LIBRARIES>")
  set(CMAKE_${lang}_CREATE_SHARED_LIBRARY
    "<CMAKE_${lang}_COMPILER> -! <FLAGS> -o <TARGET> --out-implib <TARGET_IMPLIB> <CMAKE_SHARED_LIBRARY_${lang}_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS> <OBJECTS> <LINK_LIBRARIES>")
  set(CMAKE_${lang}_CREATE_SHARED_MODULE "${CMAKE_${lang}_CREATE_SHARED_LIBRARY}")

  set(CMAKE_LIBRARY_PATH_FLAG "-L")
  set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-! -shared")

  set(CMAKE_${lang}_RESPONSE_FILE_FLAG "@")
  set(CMAKE_${lang}_RESPONSE_FILE_LINK_FLAG "@")
endmacro()


code:
include(Compiler/PGI)
__compiler_pgi(C)
string(APPEND CMAKE_C_FLAGS_MINSIZEREL_INIT " -DNDEBUG")
string(APPEND CMAKE_C_FLAGS_RELEASE_INIT " -DNDEBUG")

if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 12.10)
  set(CMAKE_C90_STANDARD_COMPILE_OPTION -c89)
  set(CMAKE_C90_EXTENSION_COMPILE_OPTION -c89)
  set(CMAKE_C90_STANDARD__HAS_FULL_SUPPORT ON)
  set(CMAKE_C99_STANDARD_COMPILE_OPTION -c99)
  set(CMAKE_C99_EXTENSION_COMPILE_OPTION -c99)
  set(CMAKE_C99_STANDARD__HAS_FULL_SUPPORT ON)
  if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 15.3)
    set(CMAKE_C11_STANDARD_COMPILE_OPTION -c11)
    set(CMAKE_C11_EXTENSION_COMPILE_OPTION -c11)
    set(CMAKE_C11_STANDARD__HAS_FULL_SUPPORT ON)
  endif ()
endif ()

__compiler_check_default_language_standard(C 12.10 90)


code:
include(Compiler/PGI)
__compiler_pgi(CXX)
string(APPEND CMAKE_CXX_FLAGS_MINSIZEREL_INIT " -DNDEBUG")
string(APPEND CMAKE_CXX_FLAGS_RELEASE_INIT " -DNDEBUG")

if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 12.10)
  set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "")
  set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION --gnu_extensions)
  set(CMAKE_CXX98_STANDARD__HAS_FULL_SUPPORT ON)
  if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 13.10)
    set(CMAKE_CXX98_STANDARD_COMPILE_OPTION --c++03)
    set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION --c++03 --gnu_extensions)
    set(CMAKE_CXX11_STANDARD_COMPILE_OPTION  --c++11)
    set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION --c++11 --gnu_extensions)
    set(CMAKE_CXX11_STANDARD__HAS_FULL_SUPPORT ON)
    if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 15.7)
      set(CMAKE_CXX14_STANDARD_COMPILE_OPTION  --c++14)
      set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION --c++14 --gnu_extensions)
      set(CMAKE_CXX14_STANDARD__HAS_FULL_SUPPORT ON)
      if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 17.1)
        set(CMAKE_CXX17_STANDARD_COMPILE_OPTION  --c++17)
        set(CMAKE_CXX17_EXTENSION_COMPILE_OPTION --c++17 --gnu_extensions)
      endif()
    endif()
  endif()
endif()

__compiler_check_default_language_standard(CXX 12.10 98)


code:
set(_compiler_id_pp_test "defined(__PGI)")

set(_compiler_id_version_compute "
# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__PGIC__)
# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(__PGIC_MINOR__)
# if defined(__PGIC_PATCHLEVEL__)
#  define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__PGIC_PATCHLEVEL__)
# endif")


code:
include(Compiler/PGI)
__compiler_pgi(Fortran)

set(CMAKE_Fortran_SUBMODULE_SEP "-")
set(CMAKE_Fortran_SUBMODULE_EXT ".mod")

set(CMAKE_Fortran_PREPROCESS_SOURCE
  "<CMAKE_Fortran_COMPILER> -Mpreprocess <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
set(CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_ON "-Mpreprocess")

set(CMAKE_Fortran_FORMAT_FIXED_FLAG "-Mnofreeform")
set(CMAKE_Fortran_FORMAT_FREE_FLAG "-Mfreeform")

string(APPEND CMAKE_Fortran_FLAGS_DEBUG_INIT " -Mbounds")

set(CMAKE_Fortran_MODDIR_FLAG "-module ")


code:
# 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_PGI)
  return()
endif()
set(__COMPILER_PGI 1)

include(Compiler/CMakeCommonCompilerMacros)

macro(__compiler_pgi lang)
  # Feature flags.
  set(CMAKE_${lang}_VERBOSE_FLAG "-v")

  # Initial configuration flags.
  string(APPEND CMAKE_${lang}_FLAGS_INIT " ")
  string(APPEND CMAKE_${lang}_FLAGS_DEBUG_INIT " -g -O0")
  string(APPEND CMAKE_${lang}_FLAGS_MINSIZEREL_INIT " -O2 -s")
  string(APPEND CMAKE_${lang}_FLAGS_RELEASE_INIT " -fast -O3")
  string(APPEND CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT " -O2 -gopt")

  if(CMAKE_HOST_WIN32)
    string(APPEND CMAKE_${lang}_FLAGS_INIT " -Bdynamic")
  endif()

  set(CMAKE_${lang}_LINKER_WRAPPER_FLAG "-Wl,")
  set(CMAKE_${lang}_LINKER_WRAPPER_FLAG_SEP ",")

  set(_CMAKE_${lang}_IPO_SUPPORTED_BY_CMAKE YES)
  if(NOT CMAKE_SYSTEM_PROCESSOR STREQUAL ppc64le AND (NOT CMAKE_HOST_WIN32 OR CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 16.3) AND CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 23.3)
    set(_CMAKE_${lang}_IPO_MAY_BE_SUPPORTED_BY_COMPILER YES)
    set(CMAKE_${lang}_COMPILE_OPTIONS_IPO "-Mipa=fast,inline")
  else()
    set(_CMAKE_${lang}_IPO_MAY_BE_SUPPORTED_BY_COMPILER NO)
  endif()

  # Preprocessing and assembly rules.
  set(CMAKE_${lang}_CREATE_PREPROCESSED_SOURCE "<CMAKE_${lang}_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
  set(CMAKE_${lang}_CREATE_ASSEMBLY_SOURCE "<CMAKE_${lang}_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
endmacro()


code:
include(Compiler/PathScale)
__compiler_pathscale(C)
string(APPEND CMAKE_C_FLAGS_MINSIZEREL_INIT " -DNDEBUG")
string(APPEND CMAKE_C_FLAGS_RELEASE_INIT " -DNDEBUG")


code:
include(Compiler/PathScale)
__compiler_pathscale(CXX)
string(APPEND CMAKE_CXX_FLAGS_MINSIZEREL_INIT " -DNDEBUG")
string(APPEND CMAKE_CXX_FLAGS_RELEASE_INIT " -DNDEBUG")


code:
set(_compiler_id_pp_test "defined(__PATHCC__)")

set(_compiler_id_version_compute "
# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__PATHCC__)
# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(__PATHCC_MINOR__)
# if defined(__PATHCC_PATCHLEVEL__)
#  define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__PATHCC_PATCHLEVEL__)
# endif")


code:
include(Compiler/PathScale)
__compiler_pathscale(Fortran)

set(CMAKE_Fortran_MODDIR_FLAG "-module ")
set(CMAKE_Fortran_FORMAT_FIXED_FLAG "-fixedform")
set(CMAKE_Fortran_FORMAT_FREE_FLAG "-freeform")

set(CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_ON "-cpp")
set(CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_OFF "-nocpp")


code:
# 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_PATHSCALE)
  return()
endif()
set(__COMPILER_PATHSCALE 1)

macro(__compiler_pathscale lang)
  # Feature flags.
  set(CMAKE_${lang}_VERBOSE_FLAG "-v")

  # Initial configuration flags.
  string(APPEND CMAKE_${lang}_FLAGS_INIT " ")
  string(APPEND CMAKE_${lang}_FLAGS_DEBUG_INIT " -g -O0")
  string(APPEND CMAKE_${lang}_FLAGS_MINSIZEREL_INIT " -Os")
  string(APPEND CMAKE_${lang}_FLAGS_RELEASE_INIT " -O3")
  string(APPEND CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT " -g -O2")
endmacro()


code: include(Compiler/GNU-C-FeatureTests)


code:
# To include compiler feature detection
include(Compiler/GNU-C)

include(Compiler/QCC)
__compiler_qcc(C)


code: include(Compiler/GNU-CXX-FeatureTests)


code:
# To include compiler feature detection
include(Compiler/GNU-CXX)

include(Compiler/QCC)
__compiler_qcc(CXX)

# If the toolchain uses qcc for CMAKE_CXX_COMPILER instead of QCC, the
# default for the driver is not c++.
set(CMAKE_CXX_COMPILE_OBJECT
  "<CMAKE_CXX_COMPILER> -lang-c++ <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT> -c <SOURCE>")

set(CMAKE_CXX_LINK_EXECUTABLE
  "<CMAKE_CXX_COMPILER> -lang-c++ <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")

set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-fvisibility-inlines-hidden")


code:
# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.

include(Compiler/GNU)

macro(__compiler_qcc lang)
  __compiler_gnu(${lang})

  # http://www.qnx.com/developers/docs/6.4.0/neutrino/utilities/q/qcc.html#examples
  set(CMAKE_${lang}_COMPILE_OPTIONS_TARGET "-V")

  set(CMAKE_PREFIX_LIBRARY_ARCHITECTURE "ON")

  set(CMAKE_${lang}_COMPILE_OPTIONS_SYSROOT "-Wc,-isysroot,")
  set(CMAKE_INCLUDE_SYSTEM_FLAG_${lang} "-Wp,-isystem,")
  set(CMAKE_DEPFILE_FLAGS_${lang} "-Wp,-MD,<DEP_FILE> -Wp,-MT,<DEP_TARGET> -Wp,-MF,<DEP_FILE>")

  set(CMAKE_${lang}_LINKER_WRAPPER_FLAG "-Wl,")
  set(CMAKE_${lang}_LINKER_WRAPPER_FLAG_SEP ",")

  set(_CMAKE_${lang}_IPO_SUPPORTED_BY_CMAKE NO)
  set(_CMAKE_${lang}_IPO_MAY_BE_SUPPORTED_BY_COMPILER NO)

  if("${lang}" STREQUAL "CXX")
    set(CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "${CMAKE_${lang}_COMPILER}")
    if(CMAKE_${lang}_COMPILER_ARG1)
      separate_arguments(_COMPILER_ARGS NATIVE_COMMAND "${CMAKE_${lang}_COMPILER_ARG1}")
      list(APPEND CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND ${_COMPILER_ARGS})
      unset(_COMPILER_ARGS)
    endif()
    list(APPEND CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "-Wp,-dM" "-E" "-c" "${CMAKE_ROOT}/Modules/CMakeCXXCompilerABI.cpp")
  endif()

  unset(CMAKE_${lang}_COMPILE_OPTIONS_IPO)
  unset(CMAKE_${lang}_ARCHIVE_CREATE_IPO)
  unset(CMAKE_${lang}_ARCHIVE_APPEND_IPO)
  unset(CMAKE_${lang}_ARCHIVE_FINISH_IPO)
endmacro()


code:
include(Compiler/SCO)
__compiler_sco(C)


code:
# 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_SCO)
  return()
endif()
set(__COMPILER_SCO 1)

macro(__compiler_sco lang)
  # Feature flags.
  set(CMAKE_${lang}_COMPILE_OPTIONS_PIC -Kpic)
  set(CMAKE_${lang}_COMPILE_OPTIONS_PIE -Kpie)
  set(CMAKE_${lang}_COMPILE_OPTIONS_DLL -belf)
  set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "-Kpic -belf")
  set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-belf -Wl,-Bexport")

  set(CMAKE_${lang}_LINKER_WRAPPER_FLAG "-Wl,")
  set(CMAKE_${lang}_LINKER_WRAPPER_FLAG_SEP ",")
endmacro()


code:
# sdcc, the small devices C compiler for embedded systems,
#   http://sdcc.sourceforge.net  */
set(_compiler_id_pp_test "defined(__SDCC_VERSION_MAJOR) || defined(SDCC)")

set(_compiler_id_version_compute "
# if defined(__SDCC_VERSION_MAJOR)
#  define COMPILER_VERSION_MAJOR @MACRO_DEC@(__SDCC_VERSION_MAJOR)
#  define COMPILER_VERSION_MINOR @MACRO_DEC@(__SDCC_VERSION_MINOR)
#  define COMPILER_VERSION_PATCH @MACRO_DEC@(__SDCC_VERSION_PATCH)
# else
  /* SDCC = VRP */
#  define COMPILER_VERSION_MAJOR @MACRO_DEC@(SDCC/100)
#  define COMPILER_VERSION_MINOR @MACRO_DEC@(SDCC/10 % 10)
#  define COMPILER_VERSION_PATCH @MACRO_DEC@(SDCC    % 10)
# endif")


code:
include(Compiler/SunPro)
__compiler_sunpro(ASM)

set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s )

set(CMAKE_ASM_VERBOSE_FLAG "-#")

set(CMAKE_SHARED_LIBRARY_ASM_FLAGS "-KPIC")
set(CMAKE_SHARED_LIBRARY_CREATE_ASM_FLAGS "-G")
set(CMAKE_SHARED_LIBRARY_RUNTIME_ASM_FLAG "-R")
set(CMAKE_SHARED_LIBRARY_RUNTIME_ASM_FLAG_SEP ":")
set(CMAKE_SHARED_LIBRARY_SONAME_ASM_FLAG "-h")

string(APPEND CMAKE_ASM_FLAGS_INIT " ")
string(APPEND CMAKE_ASM_FLAGS_DEBUG_INIT " -g")
string(APPEND CMAKE_ASM_FLAGS_MINSIZEREL_INIT " -xO2 -xspace -DNDEBUG")
string(APPEND CMAKE_ASM_FLAGS_RELEASE_INIT " -xO3 -DNDEBUG")
string(APPEND CMAKE_ASM_FLAGS_RELWITHDEBINFO_INIT " -g -xO2 -DNDEBUG")

# Initialize ASM link type selection flags.  These flags are used when
# building a shared library, shared module, or executable that links
# to other libraries to select whether to use the static or shared
# versions of the libraries.
foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
  set(CMAKE_${type}_LINK_STATIC_ASM_FLAGS "-Bstatic")
  set(CMAKE_${type}_LINK_DYNAMIC_ASM_FLAGS "-Bdynamic")
endforeach()


code:
set(_compiler_id_pp_test "defined(__SUNPRO_C)")

set(_compiler_id_version_compute "
# if __SUNPRO_C >= 0x5100
   /* __SUNPRO_C = 0xVRRP */
#  define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_HEX@(__SUNPRO_C>>12)
#  define @PREFIX@COMPILER_VERSION_MINOR @MACRO_HEX@(__SUNPRO_C>>4 & 0xFF)
#  define @PREFIX@COMPILER_VERSION_PATCH @MACRO_HEX@(__SUNPRO_C    & 0xF)
# else
   /* __SUNPRO_CC = 0xVRP */
#  define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_HEX@(__SUNPRO_C>>8)
#  define @PREFIX@COMPILER_VERSION_MINOR @MACRO_HEX@(__SUNPRO_C>>4 & 0xF)
#  define @PREFIX@COMPILER_VERSION_PATCH @MACRO_HEX@(__SUNPRO_C    & 0xF)
# endif")


code:
set(_cmake_oldestSupported "__SUNPRO_C >= 0x5130")

set(SunPro_C11 "${_cmake_oldestSupported} && defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L || __STDC_VERSION__ >= 199901L && defined(__C11FEATURES__))")
set(_cmake_feature_test_c_static_assert "${SunPro_C11}")
unset(SunPro_C11)

set(SunPro_C99 "${_cmake_oldestSupported} && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L")
set(_cmake_feature_test_c_restrict "${SunPro_C99}")
set(_cmake_feature_test_c_variadic_macros "${SunPro_C99}")
unset(SunPro_C99)

set(SunPro_C90 "${_cmake_oldestSupported}")
set(_cmake_feature_test_c_function_prototypes "${SunPro_C90}")
unset(SunPro_C90)


code:
# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.

include(Compiler/SunPro)
__compiler_sunpro(C)

set(CMAKE_C_VERBOSE_FLAG "-#")

set(CMAKE_C_COMPILE_OPTIONS_PIC -KPIC)
set(CMAKE_C_COMPILE_OPTIONS_PIE "")
set(_CMAKE_C_PIE_MAY_BE_SUPPORTED_BY_LINKER NO)
set(CMAKE_C_LINK_OPTIONS_PIE "")
set(CMAKE_C_LINK_OPTIONS_NO_PIE "")
set(CMAKE_SHARED_LIBRARY_C_FLAGS "-KPIC")
set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-G")
set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-R")
set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":")
set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-h")

string(APPEND CMAKE_C_FLAGS_INIT " ")
string(APPEND CMAKE_C_FLAGS_DEBUG_INIT " -g")
string(APPEND CMAKE_C_FLAGS_MINSIZEREL_INIT " -xO2 -xspace -DNDEBUG")
string(APPEND CMAKE_C_FLAGS_RELEASE_INIT " -xO3 -DNDEBUG")
string(APPEND CMAKE_C_FLAGS_RELWITHDEBINFO_INIT " -g -xO2 -DNDEBUG")

set(CMAKE_DEPFILE_FLAGS_C "-xMD -xMF <DEP_FILE>")

# Initialize C link type selection flags.  These flags are used when
# building a shared library, shared module, or executable that links
# to other libraries to select whether to use the static or shared
# versions of the libraries.
foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
  set(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Bstatic")
  set(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Bdynamic")
endforeach()

if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "5.12")
  set(CMAKE_C_LINKER_WRAPPER_FLAG "-Qoption" "ld" " ")
  set(CMAKE_C_LINKER_WRAPPER_FLAG_SEP ",")
else()
  set(CMAKE_C_LINKER_WRAPPER_FLAG "-Wl,")
  set(CMAKE_C_LINKER_WRAPPER_FLAG_SEP ",")
endif()

if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 5.13)
  set(CMAKE_C90_STANDARD_COMPILE_OPTION "-std=c89")
  set(CMAKE_C90_EXTENSION_COMPILE_OPTION "-std=c89")
  set(CMAKE_C90_STANDARD__HAS_FULL_SUPPORT ON)
  set(CMAKE_C99_STANDARD_COMPILE_OPTION "-std=c99")
  set(CMAKE_C99_EXTENSION_COMPILE_OPTION "-std=c99")
  set(CMAKE_C99_STANDARD__HAS_FULL_SUPPORT ON)
  set(CMAKE_C11_STANDARD_COMPILE_OPTION "-std=c11")
  set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-std=c11")
  set(CMAKE_C11_STANDARD__HAS_FULL_SUPPORT ON)
elseif (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 5.11)
  set(CMAKE_C90_STANDARD_COMPILE_OPTION "")
  set(CMAKE_C90_EXTENSION_COMPILE_OPTION "")
  set(CMAKE_C99_STANDARD_COMPILE_OPTION "-xc99")
  set(CMAKE_C99_EXTENSION_COMPILE_OPTION "-xc99")
endif()

__compiler_check_default_language_standard(C 5.11 90 5.14 11)

set(CMAKE_C_CREATE_PREPROCESSED_SOURCE "<CMAKE_C_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
set(CMAKE_C_CREATE_ASSEMBLY_SOURCE "<CMAKE_C_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")


code:
set(_compiler_id_pp_test "defined(__SUNPRO_CC)")

set(_compiler_id_version_compute "
# if __SUNPRO_CC >= 0x5100
   /* __SUNPRO_CC = 0xVRRP */
#  define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_HEX@(__SUNPRO_CC>>12)
#  define @PREFIX@COMPILER_VERSION_MINOR @MACRO_HEX@(__SUNPRO_CC>>4 & 0xFF)
#  define @PREFIX@COMPILER_VERSION_PATCH @MACRO_HEX@(__SUNPRO_CC    & 0xF)
# else
   /* __SUNPRO_CC = 0xVRP */
#  define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_HEX@(__SUNPRO_CC>>8)
#  define @PREFIX@COMPILER_VERSION_MINOR @MACRO_HEX@(__SUNPRO_CC>>4 & 0xF)
#  define @PREFIX@COMPILER_VERSION_PATCH @MACRO_HEX@(__SUNPRO_CC    & 0xF)
# endif")


code:
# Based on GNU 4.8.2
# https://docs.oracle.com/cd/E37069_01/html/E37071/gncix.html
# https://docs.oracle.com/cd/E77782_01/html/E77784/gkeza.html
# Reference: http://gcc.gnu.org/projects/cxx0x.html

set(_cmake_oldestSupported "__SUNPRO_CC >= 0x5130")

set(SolarisStudio126_CXX14 "(__SUNPRO_CC >= 0x5150) && __cplusplus >= 201402L")
set(_cmake_feature_test_cxx_aggregate_default_initializers "${SolarisStudio126_CXX14}")
set(_cmake_feature_test_cxx_digit_separators "${SolarisStudio126_CXX14}")
set(_cmake_feature_test_cxx_generic_lambdas "${SolarisStudio126_CXX14}")
set(_cmake_feature_test_cxx_lambda_init_captures "${SolarisStudio126_CXX14}")
set(_cmake_feature_test_cxx_return_type_deduction "${SolarisStudio126_CXX14}")
set(_cmake_feature_test_cxx_variable_templates "${SolarisStudio126_CXX14}")

set(SolarisStudio126_CXX11 "(__SUNPRO_CC >= 0x5150) && __cplusplus >= 201103L")
set(_cmake_feature_test_cxx_decltype_auto "${SolarisStudio126_CXX11}")

set(SolarisStudio125_CXX11 "(__SUNPRO_CC >= 0x5140) && __cplusplus >= 201103L")
set(_cmake_feature_test_cxx_binary_literals "${SolarisStudio125_CXX11}")
set(_cmake_feature_test_cxx_reference_qualified_functions "${SolarisStudio125_CXX11}")

set(SolarisStudio124_CXX11 "(__SUNPRO_CC >= 0x5130) && __cplusplus >= 201103L")
set(_cmake_feature_test_cxx_alignas "${SolarisStudio124_CXX11}")
set(_cmake_feature_test_cxx_alignof "${SolarisStudio124_CXX11}")
set(_cmake_feature_test_cxx_attributes "${SolarisStudio124_CXX11}")
set(_cmake_feature_test_cxx_inheriting_constructors "${SolarisStudio124_CXX11}")
set(_cmake_feature_test_cxx_thread_local "${SolarisStudio124_CXX11}")
set(_cmake_feature_test_cxx_alias_templates "${SolarisStudio124_CXX11}")
set(_cmake_feature_test_cxx_delegating_constructors "${SolarisStudio124_CXX11}")
set(_cmake_feature_test_cxx_extended_friend_declarations "${SolarisStudio124_CXX11}")
set(_cmake_feature_test_cxx_final "${SolarisStudio124_CXX11}")
set(_cmake_feature_test_cxx_noexcept "${SolarisStudio124_CXX11}")
set(_cmake_feature_test_cxx_nonstatic_member_init "${SolarisStudio124_CXX11}")
set(_cmake_feature_test_cxx_override "${SolarisStudio124_CXX11}")
set(_cmake_feature_test_cxx_constexpr "${SolarisStudio124_CXX11}")
set(_cmake_feature_test_cxx_defaulted_move_initializers "${SolarisStudio124_CXX11}")
set(_cmake_feature_test_cxx_enum_forward_declarations "${SolarisStudio124_CXX11}")
set(_cmake_feature_test_cxx_nullptr "${SolarisStudio124_CXX11}")
set(_cmake_feature_test_cxx_range_for "${SolarisStudio124_CXX11}")
set(_cmake_feature_test_cxx_unrestricted_unions "${SolarisStudio124_CXX11}")
set(_cmake_feature_test_cxx_explicit_conversions "${SolarisStudio124_CXX11}")
set(_cmake_feature_test_cxx_lambdas "${SolarisStudio124_CXX11}")
set(_cmake_feature_test_cxx_local_type_template_args "${SolarisStudio124_CXX11}")
set(_cmake_feature_test_cxx_raw_string_literals "${SolarisStudio124_CXX11}")
set(_cmake_feature_test_cxx_auto_type "${SolarisStudio124_CXX11}")
set(_cmake_feature_test_cxx_defaulted_functions "${SolarisStudio124_CXX11}")
set(_cmake_feature_test_cxx_deleted_functions "${SolarisStudio124_CXX11}")
set(_cmake_feature_test_cxx_generalized_initializers "${SolarisStudio124_CXX11}")
set(_cmake_feature_test_cxx_inline_namespaces "${SolarisStudio124_CXX11}")
set(_cmake_feature_test_cxx_sizeof_member "${SolarisStudio124_CXX11}")
set(_cmake_feature_test_cxx_strong_enums "${SolarisStudio124_CXX11}")
set(_cmake_feature_test_cxx_trailing_return_types "${SolarisStudio124_CXX11}")
set(_cmake_feature_test_cxx_unicode_literals "${SolarisStudio124_CXX11}")
set(_cmake_feature_test_cxx_uniform_initialization "${SolarisStudio124_CXX11}")
set(_cmake_feature_test_cxx_variadic_templates "${SolarisStudio124_CXX11}")
set(_cmake_feature_test_cxx_decltype "${SolarisStudio124_CXX11}")
set(_cmake_feature_test_cxx_default_function_template_args "${SolarisStudio124_CXX11}")
set(_cmake_feature_test_cxx_long_long_type "${SolarisStudio124_CXX11}")
set(_cmake_feature_test_cxx_right_angle_brackets "${SolarisStudio124_CXX11}")
set(_cmake_feature_test_cxx_rvalue_references "${SolarisStudio124_CXX11}")
set(_cmake_feature_test_cxx_static_assert "${SolarisStudio124_CXX11}")
set(_cmake_feature_test_cxx_extern_templates "${SolarisStudio124_CXX11}")
set(_cmake_feature_test_cxx_func_identifier "${SolarisStudio124_CXX11}")
set(_cmake_feature_test_cxx_variadic_macros "${SolarisStudio124_CXX11}")

set(_cmake_feature_test_cxx_template_template_parameters "${_cmake_oldestSupported} && __cplusplus")


code:
# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.

include(Compiler/SunPro)
__compiler_sunpro(CXX)

set(CMAKE_CXX_VERBOSE_FLAG "-v")

set(CMAKE_CXX_COMPILE_OPTIONS_PIC -KPIC)
set(CMAKE_CXX_COMPILE_OPTIONS_PIE "")
set(_CMAKE_CXX_PIE_MAY_BE_SUPPORTED_BY_LINKER NO)
set(CMAKE_CXX_LINK_OPTIONS_PIE "")
set(CMAKE_CXX_LINK_OPTIONS_NO_PIE "")
set(CMAKE_SHARED_LIBRARY_CXX_FLAGS "-KPIC")
set(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "-G")
set(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG "-R")
set(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP ":")
set(CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG "-h")

string(APPEND CMAKE_CXX_FLAGS_INIT " ")
string(APPEND CMAKE_CXX_FLAGS_DEBUG_INIT " -g")
string(APPEND CMAKE_CXX_FLAGS_MINSIZEREL_INIT " -xO2 -xspace -DNDEBUG")
string(APPEND CMAKE_CXX_FLAGS_RELEASE_INIT " -xO3 -DNDEBUG")
string(APPEND CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT " -g -xO2 -DNDEBUG")

set(CMAKE_DEPFILE_FLAGS_CXX "-xMD -xMF <DEP_FILE>")

# Initialize C link type selection flags.  These flags are used when
# building a shared library, shared module, or executable that links
# to other libraries to select whether to use the static or shared
# versions of the libraries.
foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
  set(CMAKE_${type}_LINK_STATIC_CXX_FLAGS "-Bstatic")
  set(CMAKE_${type}_LINK_DYNAMIC_CXX_FLAGS "-Bdynamic")
endforeach()

set(CMAKE_CXX_LINKER_WRAPPER_FLAG "-Qoption" "ld" " ")
set(CMAKE_CXX_LINKER_WRAPPER_FLAG_SEP ",")

set(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE "<CMAKE_CXX_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
set(CMAKE_CXX_CREATE_ASSEMBLY_SOURCE "<CMAKE_CXX_COMPILER> <INCLUDES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")

# Create archives with "CC -xar" in case user adds "-instances=extern"
# so that template instantiations are available to archive members.
set(CMAKE_CXX_CREATE_STATIC_LIBRARY
  "<CMAKE_CXX_COMPILER> -xar -o <TARGET> <OBJECTS> "
  "<CMAKE_RANLIB> <TARGET> ")

if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.13)
  set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "-std=c++03")
  set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "-std=c++03")
  set(CMAKE_CXX98_STANDARD__HAS_FULL_SUPPORT ON)
  set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++11")
  set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=c++11")
  set(CMAKE_CXX_LINK_WITH_STANDARD_COMPILE_OPTION 1)

  if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.14)
    set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "-std=c++14")
    set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "-std=c++14")
  endif()
else()
  set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "-library=stlport4")
  set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "-library=stlport4")
  set(CMAKE_CXX_LINK_WITH_STANDARD_COMPILE_OPTION 1)
endif()

__compiler_check_default_language_standard(CXX 1 98)


code:
include(Compiler/SunPro)
__compiler_sunpro(Fortran)

set(CMAKE_Fortran_VERBOSE_FLAG "-v")
set(CMAKE_Fortran_FORMAT_FIXED_FLAG "-fixed")
set(CMAKE_Fortran_FORMAT_FREE_FLAG "-free")

set(CMAKE_Fortran_COMPILE_OPTIONS_PIC "-KPIC")
set(CMAKE_Fortran_COMPILE_OPTIONS_PIE "")
set(_CMAKE_Fortran_PIE_MAY_BE_SUPPORTED_BY_LINKER NO)
set(CMAKE_Fortran_LINK_OPTIONS_PIE "")
set(CMAKE_Fortran_LINK_OPTIONS_NO_PIE "")
set(CMAKE_SHARED_LIBRARY_Fortran_FLAGS "-KPIC")
set(CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS "-G")
set(CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG "-R")
set(CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG_SEP ":")
set(CMAKE_SHARED_LIBRARY_SONAME_Fortran_FLAG "-h")
set(CMAKE_EXECUTABLE_RUNTIME_Fortran_FLAG "-R")

string(APPEND CMAKE_Fortran_FLAGS_INIT " ")
string(APPEND CMAKE_Fortran_FLAGS_DEBUG_INIT " -g")
string(APPEND CMAKE_Fortran_FLAGS_MINSIZEREL_INIT " -xO2 -xspace -DNDEBUG")
string(APPEND CMAKE_Fortran_FLAGS_RELEASE_INIT " -xO3 -DNDEBUG")
string(APPEND CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT " -g -xO2 -DNDEBUG")
set(CMAKE_Fortran_MODDIR_FLAG "-moddir=")
set(CMAKE_Fortran_MODPATH_FLAG "-M")

set(CMAKE_Fortran_LINKER_WRAPPER_FLAG "-Qoption" "ld" " ")
set(CMAKE_Fortran_LINKER_WRAPPER_FLAG_SEP ",")

set(CMAKE_Fortran_PREPROCESS_SOURCE
  "<CMAKE_Fortran_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -F -fpp <SOURCE> -o <PREPROCESSED_SOURCE>")

set(CMAKE_Fortran_CREATE_PREPROCESSED_SOURCE "<CMAKE_Fortran_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -F -fpp <SOURCE> -o <PREPROCESSED_SOURCE>")
set(CMAKE_Fortran_CREATE_ASSEMBLY_SOURCE "<CMAKE_Fortran_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")

set(CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_ON "-fpp")


code:
# 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_SUNPRO)
  return()
endif()
set(__COMPILER_SUNPRO 1)

include(Compiler/CMakeCommonCompilerMacros)

macro(__compiler_sunpro lang)
  set(CMAKE_${lang}_COMPILE_OPTIONS_WARNING_AS_ERROR "-errwarn=%all")
endmacro()


code:
include(Compiler/TI)
__compiler_ti(ASM)

set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS asm;s;abs)


code:
include(Compiler/TI)
__compiler_ti(C)

# Architecture specific
# C99 versions: https://processors.wiki.ti.com/index.php/C99_Support_in_TI_Compilers

if("${CMAKE_C_COMPILER_ARCHITECTURE_ID}" STREQUAL "ARM")
  set(__COMPILER_TI_C99_VERSION_ARM 5.2)
  set(__COMPILER_TI_C11_VERSION_ARM 18.12)

elseif("${CMAKE_C_COMPILER_ARCHITECTURE_ID}" STREQUAL "MSP430")
  set(__COMPILER_TI_C99_VERSION_MSP430 4.3)
  set(__COMPILER_TI_C11_VERSION_MSP430 18.12)

elseif("${CMAKE_C_COMPILER_ARCHITECTURE_ID}" STREQUAL "TMS320C28x")
  set(__COMPILER_TI_C99_VERSION_TMS320C28x 6.3)
  set(__COMPILER_TI_C11_VERSION_TMS320C28x 18.9)

elseif("${CMAKE_C_COMPILER_ARCHITECTURE_ID}" STREQUAL "TMS320C6x")
  set(__COMPILER_TI_C99_VERSION_TMS320C6x 7.5)

else()
  # architecture not handled
  return()

endif()

if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "${__COMPILER_TI_C99_VERSION_${CMAKE_C_COMPILER_ARCHITECTURE_ID}}")

  set(CMAKE_C90_STANDARD_COMPILE_OPTION "--c89" "--strict_ansi")
  set(CMAKE_C90_EXTENSION_COMPILE_OPTION "--c89" "--relaxed_ansi")

  set(CMAKE_C99_STANDARD_COMPILE_OPTION "--c99" "--strict_ansi")
  set(CMAKE_C99_EXTENSION_COMPILE_OPTION "--c99" "--relaxed_ansi")

  if(DEFINED __COMPILER_TI_C11_VERSION_${CMAKE_C_COMPILER_ARCHITECTURE_ID} AND
     CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "${__COMPILER_TI_C11_VERSION_${CMAKE_C_COMPILER_ARCHITECTURE_ID}}")

    set(CMAKE_C11_STANDARD_COMPILE_OPTION "--c11" "--strict_ansi")
    set(CMAKE_C11_EXTENSION_COMPILE_OPTION "--c11" "--relaxed_ansi")

  endif()

else()

  set(CMAKE_C90_STANDARD_COMPILE_OPTION "--strict_ansi")
  set(CMAKE_C90_EXTENSION_COMPILE_OPTION "--relaxed_ansi")

endif()

# Architecture specific

if("${CMAKE_C_COMPILER_ARCHITECTURE_ID}" STREQUAL "ARM")
  __compiler_check_default_language_standard(C 2.0 90)

elseif("${CMAKE_C_COMPILER_ARCHITECTURE_ID}" STREQUAL "MSP430")
  __compiler_check_default_language_standard(C 3.0 90)

elseif("${CMAKE_C_COMPILER_ARCHITECTURE_ID}" STREQUAL "TMS320C28x")
  __compiler_check_default_language_standard(C 4.1 90)

elseif("${CMAKE_C_COMPILER_ARCHITECTURE_ID}" STREQUAL "TMS320C6x")
  __compiler_check_default_language_standard(C 4.45 90)

endif()


code:
include(Compiler/TI)
__compiler_ti(CXX)

# Architecture specific

if("${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "ARM")
  set(__COMPILER_TI_CXX03_VERSION 5.2)
  set(__COMPILER_TI_CXX14_VERSION 18.1)

elseif("${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "MSP430")
  set(__COMPILER_TI_CXX03_VERSION 4.4)
  set(__COMPILER_TI_CXX14_VERSION 18.1)

elseif("${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "TMS320C28x")
  set(__COMPILER_TI_CXX03_VERSION 16.9)

elseif("${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "TMS320C6x")
  set(__COMPILER_TI_CXX03_VERSION 8.1)
  set(__COMPILER_TI_CXX14_VERSION 8.3)

else()
  # architecture not handled
  return()

endif()

if(DEFINED __COMPILER_TI_CXX14_VERSION AND
   CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "${__COMPILER_TI_CXX14_VERSION}")

  # C++03 is not supported anymore
  set(CMAKE_CXX98_STANDARD_COMPILE_OPTION  "--strict_ansi")
  set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "--relaxed_ansi")

  # C++11 was never supported
  set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "--strict_ansi")
  set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "--relaxed_ansi")

  set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "--c++14" "--strict_ansi")
  set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "--c++14" "--relaxed_ansi")

elseif(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "${__COMPILER_TI_CXX03_VERSION}")

  set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "--c++03" "--strict_ansi")
  set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "--c++03" "--relaxed_ansi")

else()

  set(CMAKE_CXX98_STANDARD_COMPILE_OPTION  "--strict_ansi")
  set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "--relaxed_ansi")

endif()

# Architecture specific
# CXX98 versions: https://processors.wiki.ti.com/index.php/C%2B%2B_Support_in_TI_Compilers

if("${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "ARM")
  __compiler_check_default_language_standard(CXX 4.5 98 ${__COMPILER_TI_CXX14_VERSION} 14)

elseif("${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "MSP430")
  __compiler_check_default_language_standard(CXX 3.0 98 ${__COMPILER_TI_CXX14_VERSION} 14)

elseif("${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "TMS320C28x")
  __compiler_check_default_language_standard(CXX 5.1 98)

elseif("${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "TMS320C6x")
  __compiler_check_default_language_standard(CXX 6.1 98 ${__COMPILER_TI_CXX14_VERSION} 14)

endif()


code:
set(_compiler_id_pp_test "defined(__TI_COMPILER_VERSION__)")

set(_compiler_id_version_compute "
  /* __TI_COMPILER_VERSION__ = VVVRRRPPP */
# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__TI_COMPILER_VERSION__/1000000)
# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(__TI_COMPILER_VERSION__/1000   % 1000)
# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__TI_COMPILER_VERSION__        % 1000)")


code:
# 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_TI)
  return()
endif()
set(__COMPILER_TI 1)

include(Compiler/CMakeCommonCompilerMacros)

set(__COMPILER_TI_SOURCE_FLAG_C   "--c_file")
set(__COMPILER_TI_SOURCE_FLAG_CXX "--cpp_file")
set(__COMPILER_TI_SOURCE_FLAG_ASM "--asm_file")

macro(__compiler_ti lang)
  set(CMAKE_${lang}_COMPILE_OPTIONS_WARNING_AS_ERROR "--emit_warnings_as_errors")
  set(CMAKE_${lang}_RESPONSE_FILE_FLAG "--cmd_file=")
  # Using --cmd_file flag is not possible after the --run_linker flag.
  # By using a whitespace only the filename is used without flag.
  # That file is interpreted as linker command file which may contain files to link.
  set(CMAKE_${lang}_RESPONSE_FILE_LINK_FLAG " ")

  set(CMAKE_INCLUDE_FLAG_${lang} "--include_path=")
  set(CMAKE_DEPFILE_FLAGS_${lang} "--preproc_with_compile --preproc_dependency=<DEP_FILE>")

  set(CMAKE_${lang}_CREATE_PREPROCESSED_SOURCE "<CMAKE_${lang}_COMPILER> --preproc_only ${__COMPILER_TI_SOURCE_FLAG_${lang}}=<SOURCE> <DEFINES> <INCLUDES> <FLAGS> --output_file=<PREPROCESSED_SOURCE>")
  set(CMAKE_${lang}_CREATE_ASSEMBLY_SOURCE     "<CMAKE_${lang}_COMPILER> --compile_only --skip_assembler ${__COMPILER_TI_SOURCE_FLAG_${lang}}=<SOURCE> <DEFINES> <INCLUDES> <FLAGS> --output_file=<ASSEMBLY_SOURCE>")

  set(CMAKE_${lang}_COMPILE_OBJECT  "<CMAKE_${lang}_COMPILER> --compile_only ${__COMPILER_TI_SOURCE_FLAG_${lang}}=<SOURCE> <DEFINES> <INCLUDES> <FLAGS> --output_file=<OBJECT>")

  set(CMAKE_${lang}_ARCHIVE_CREATE "<CMAKE_AR> qr <TARGET> <OBJECTS>")
  set(CMAKE_${lang}_ARCHIVE_APPEND "<CMAKE_AR> qa <TARGET> <OBJECTS>")
  set(CMAKE_${lang}_ARCHIVE_FINISH "")

  set(CMAKE_${lang}_LINK_EXECUTABLE "<CMAKE_${lang}_COMPILER> <FLAGS> --run_linker --output_file=<TARGET> --map_file=<TARGET_NAME>.map <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> <LINK_LIBRARIES>")
endmacro()

set(CMAKE_LIBRARY_PATH_FLAG "--search_path=")
set(CMAKE_LINK_LIBRARY_FLAG "--library=")


code:
include(Compiler/TIClang)

set(CMAKE_ASM_OUTPUT_EXTENSION ".o")
set(CMAKE_ASM_OUTPUT_EXTENSION_REPLACE 1)

set(CMAKE_ASM_COMPILE_OBJECT       "<CMAKE_ASM_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -c -o <OBJECT> <SOURCE>")
set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS S;s;asm;msa)

__compiler_ticlang(ASM)


code: include(Compiler/Clang-C-FeatureTests)


code:
include(Compiler/Clang-C)
include(Compiler/TIClang)
__compiler_ticlang(C)

if((NOT DEFINED CMAKE_DEPENDS_USE_COMPILER OR CMAKE_DEPENDS_USE_COMPILER)
    AND CMAKE_GENERATOR MATCHES "Makefiles|WMake"
    AND CMAKE_DEPFILE_FLAGS_C)
  # dependencies are computed by the compiler itself
  set(CMAKE_C_DEPFILE_FORMAT gcc)
  set(CMAKE_C_DEPENDS_USE_COMPILER TRUE)
endif()

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)


code:
include(Compiler/Clang-CXX)
include(Compiler/TIClang)
__compiler_ticlang(CXX)

if((NOT DEFINED CMAKE_DEPENDS_USE_COMPILER OR CMAKE_DEPENDS_USE_COMPILER)
    AND CMAKE_GENERATOR MATCHES "Makefiles|WMake"
    AND CMAKE_DEPFILE_FLAGS_CXX)
  # dependencies are computed by the compiler itself
  set(CMAKE_CXX_DEPFILE_FORMAT gcc)
  set(CMAKE_CXX_DEPENDS_USE_COMPILER TRUE)
endif()

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_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")


code:
# TI Clang-based Toolchains
set(_compiler_id_pp_test "defined(__clang__) && defined(__ti__)")

set(_compiler_id_version_compute "
  # define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__ti_major__)
  # define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(__ti_minor__)
  # define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__ti_patchlevel__)")

string(APPEND _compiler_id_version_compute "
# define @PREFIX@COMPILER_VERSION_INTERNAL @MACRO_DEC@(__ti_version__)")


code:
if(__COMPILER_TICLANG)
  return()
endif()
set(__COMPILER_TICLANG TRUE)

include(Compiler/CMakeCommonCompilerMacros)

# get linker supported cpu list
macro(__compiler_ticlang lang)
  set(CMAKE_${lang}_RESPONSE_FILE_LINK_FLAG "-Xlinker ")

  set(CMAKE_${lang}_CREATE_PREPROCESSED_SOURCE "<CMAKE_${lang}_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")

  set(CMAKE_${lang}_CREATE_ASSEMBLY_SOURCE "<CMAKE_${lang}_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")

  set(CMAKE_${lang}_COMPILE_OBJECT  "<CMAKE_${lang}_COMPILER> -c <SOURCE> <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT>")

  set(CMAKE_${lang}_LINK_EXECUTABLE "<CMAKE_${lang}_COMPILER> <FLAGS> -Xlinker --output_file=<TARGET> -Xlinker --map_file=<TARGET_NAME>.map -Xlinker --rom_model <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> <LINK_LIBRARIES>")

  set(CMAKE_${lang}_ARCHIVE_CREATE  "<CMAKE_AR> cr <TARGET> <OBJECTS>")
  set(CMAKE_${lang}_ARCHIVE_APPEND  "<CMAKE_AR> r <TARGET> <OBJECTS>")
  set(CMAKE_${lang}_ARCHIVE_FINISH  "")

  set(CMAKE_${lang}_LINKER_WRAPPER_FLAG "-Xlinker" " ")
  set(CMAKE_${lang}_LINKER_WRAPPER_FLAG_SEP)
endmacro()

set(CMAKE_EXECUTABLE_SUFFIX ".out")
set(CMAKE_LIBRARY_PATH_FLAG "-Wl,--search_path=")
set(CMAKE_LINK_LIBRARY_FLAG "-Wl,--library=")


code:
include(Compiler/Tasking)

set(CMAKE_ASM_OUTPUT_EXTENSION ".o")
set(CMAKE_ASM_OUTPUT_EXTENSION_REPLACE 1)

set(CMAKE_ASM_COMPILE_OBJECT       "<CMAKE_ASM_COMPILER> <INCLUDES> <FLAGS> -o <OBJECT> <SOURCE>")
set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS S;s;asm;msa)


code:
include(Compiler/Tasking)
__compiler_tasking(C)

set(CMAKE_C90_STANDARD_COMPILE_OPTION "--iso=90" "--strict")
set(CMAKE_C90_EXTENSION_COMPILE_OPTION "--iso=90" " ")

set(CMAKE_C99_STANDARD_COMPILE_OPTION "--iso=99" "--strict")
set(CMAKE_C99_EXTENSION_COMPILE_OPTION "--iso=99" " ")

set(CMAKE_C11_STANDARD_COMPILE_OPTION "--iso=11" "--strict")
set(CMAKE_C11_EXTENSION_COMPILE_OPTION "--iso=11" " ")

if(CMAKE_C_COMPILER_ARCHITECTURE_ID STREQUAL "TriCore")
  if(CMAKE_TASKING_TOOLSET STREQUAL "SmartCode")
    __compiler_check_default_language_standard(C 10.1 11)
  else()
    __compiler_check_default_language_standard(C 6.3 11)
  endif()
elseif(CMAKE_C_COMPILER_ARCHITECTURE_ID STREQUAL "ARM")
  if(CMAKE_TASKING_TOOLSET STREQUAL "SmartCode")
    __compiler_check_default_language_standard(C 10.1 11)
  elseif(CMAKE_TASKING_TOOLSET STREQUAL "TriCore")
    __compiler_check_default_language_standard(C 6.3 11)
  else()
    __compiler_check_default_language_standard(C 6.0 11)
  endif()
elseif(CMAKE_C_COMPILER_ARCHITECTURE_ID STREQUAL "MCS")
  if(CMAKE_TASKING_TOOLSET STREQUAL "SmartCode")
    __compiler_check_default_language_standard(C 10.1 11)
  elseif(CMAKE_TASKING_TOOLSET STREQUAL "TriCore")
    __compiler_check_default_language_standard(C 6.3 11)
  else()
    __compiler_check_default_language_standard(C 3.3 11)
  endif()
elseif(CMAKE_C_COMPILER_ARCHITECTURE_ID STREQUAL "ARC")
  __compiler_check_default_language_standard(C 10.1 11)
elseif(CMAKE_C_COMPILER_ARCHITECTURE_ID STREQUAL "8051")
  if(CMAKE_TASKING_TOOLSET STREQUAL "SmartCode")
    __compiler_check_default_language_standard(C 10.1 11)
  elseif(CMAKE_TASKING_TOOLSET STREQUAL "TriCore")
    __compiler_check_default_language_standard(C 6.3 11)
  else()
    __compiler_check_default_language_standard(C 7.2 89)
  endif()
elseif(CMAKE_C_COMPILER_ARCHITECTURE_ID STREQUAL "PCP")
  __compiler_check_default_language_standard(C 6.3 11)
endif()


code:
# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
include(Compiler/Tasking)
__compiler_tasking(CXX)

set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "--c++=03" "--strict")
set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "--iso=03" " ")

set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "--c++=11" "--strict")
set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "--c++=11" " ")

set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "--c++=14" "--strict")
set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "--c++=14" " ")

if(CMAKE_CXX_COMPILER_ARCHITECTURE_ID STREQUAL "TriCore")
  if(CMAKE_TASKING_TOOLSET STREQUAL "SmartCode")
    __compiler_check_default_language_standard(CXX 10.1 14)
  else()
    __compiler_check_default_language_standard(CXX 6.3 14)
  endif()
elseif(CMAKE_CXX_COMPILER_ARCHITECTURE_ID STREQUAL "ARM")
  if(CMAKE_TASKING_TOOLSET STREQUAL "SmartCode")
    __compiler_check_default_language_standard(CXX 10.1 14)
  elseif(CMAKE_TASKING_TOOLSET STREQUAL "TriCore")
    __compiler_check_default_language_standard(CXX 6.3 14)
  else()
    __compiler_check_default_language_standard(CXX 6.0 14)
  endif()
else()
  message(FATAL_ERROR "CXX is not supported with the ${CMAKE_CXX_COMPILER_ARCHITECTURE_ID} architecture.")
endif()


code:
# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
set(_compiler_id_pp_test "defined(__TASKING__)")

set(_compiler_id_version_compute "
  # define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__VERSION__/1000)
  # define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(__VERSION__ % 100)")

string(APPEND _compiler_id_version_compute "
# define @PREFIX@COMPILER_VERSION_INTERNAL @MACRO_DEC@(__VERSION__)")


code:
# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.

# Find the archiver for the compiler architecture, which is always in the same
# directory as the compiler.
if(NOT DEFINED _CMAKE_PROCESSING_LANGUAGE OR _CMAKE_PROCESSING_LANGUAGE STREQUAL "")
  message(FATAL_ERROR "Internal error: _CMAKE_PROCESSING_LANGUAGE is not set")
endif()

get_filename_component(__tasking_hints "${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER}" DIRECTORY)

find_program(CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_AR
  NAMES artc ararm armcs ar51 ararc arpcp
  HINTS ${__tasking_hints}
  NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH
  DOC "Tasking Archiver"
)
mark_as_advanced(CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_AR)


code:
# 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(_Tasking_CMAKE_LOADED)
  return()
endif()
set(_Tasking_CMAKE_LOADED TRUE)
include(Compiler/CMakeCommonCompilerMacros)

set(CMAKE_EXECUTABLE_SUFFIX ".elf")
set(CMAKE_STATIC_LIBRARY_SUFFIX ".a")
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)

set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE)
set(BUILD_SHARED_LIBS FALSE CACHE BOOL "")
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
set(CMAKE_LINK_SEARCH_START_STATIC TRUE)

if(NOT CMAKE_TASKING_TOOLSET)
  set(CMAKE_TASKING_TOOLSET "Standalone")
endif()

macro(__compiler_tasking lang)

  set(CMAKE_${lang}_VERBOSE_FLAG "-v")
  set(CMAKE_${lang}_COMPILE_OPTIONS_PIC "--pic")
  set(CMAKE_${lang}_LINKER_WRAPPER_FLAG "-Wl" " ")
  set(CMAKE_${lang}_RESPONSE_FILE_LINK_FLAG "-f ")
  set(CMAKE_DEPFILE_FLAGS_${lang} "--dep-file=<DEP_FILE>")
  set(CMAKE_${lang}_COMPILE_OPTIONS_WARNING_AS_ERROR "--warning-as-errors")

  string(APPEND CMAKE_${lang}_FLAGS_INIT " ")
  string(APPEND CMAKE_${lang}_FLAGS_DEBUG_INIT " -O0 -g")
  string(APPEND CMAKE_${lang}_FLAGS_MINSIZEREL_INIT " -O2 -t4 -DNDEBUG")
  string(APPEND CMAKE_${lang}_FLAGS_RELEASE_INIT " -O2 -t2 -DNDEBUG")
  string(APPEND CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT " -O2 -t2 -g -DNDEBUG")

  set(CMAKE_${lang}_ARCHIVE_CREATE "\"${CMAKE_${lang}_COMPILER_AR}\" -r <TARGET> <OBJECTS>")
  set(CMAKE_${lang}_ARCHIVE_APPEND "\"${CMAKE_${lang}_COMPILER_AR}\" -r <TARGET> <OBJECTS>")
  set(CMAKE_${lang}_ARCHIVE_FINISH "")

  set(CMAKE_${lang}_CREATE_ASSEMBLY_SOURCE "<CMAKE_${lang}_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -cs <SOURCE> -o <ASSEMBLY_SOURCE>")
  set(CMAKE_${lang}_CREATE_PREPROCESSED_SOURCE "<CMAKE_${lang}_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -Ep <SOURCE> > <PREPROCESSED_SOURCE>")

  if("${lang}" STREQUAL "CXX")
    set(CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "${CMAKE_${lang}_COMPILER}")
    if(CMAKE_${lang}_COMPILER_ARG1)
      separate_arguments(_COMPILER_ARGS NATIVE_COMMAND "${CMAKE_${lang}_COMPILER_ARG1}")
      list(APPEND CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND ${_COMPILER_ARGS})
      unset(_COMPILER_ARGS)
    endif()
    list(APPEND CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "-Ep" "${CMAKE_ROOT}/Modules/CMakeCXXCompilerABI.cpp")
  endif()

endmacro()


code:
set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared")

# no optimization in tcc:
string(APPEND CMAKE_C_FLAGS_INIT " ")
string(APPEND CMAKE_C_FLAGS_DEBUG_INIT " -g")
string(APPEND CMAKE_C_FLAGS_MINSIZEREL_INIT " -DNDEBUG")
string(APPEND CMAKE_C_FLAGS_RELEASE_INIT " -DNDEBUG")
string(APPEND CMAKE_C_FLAGS_RELWITHDEBINFO_INIT " -g -DNDEBUG")

set(CMAKE_C_LINKER_WRAPPER_FLAG "-Wl,")
set(CMAKE_C_LINKER_WRAPPER_FLAG_SEP ",")


code:
set(_compiler_id_pp_test "defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ < 800")

include("${CMAKE_CURRENT_LIST_DIR}/IBMCPP-C-DetermineVersionInternal.cmake")


code: include(Compiler/XL-C)


code:
set(_compiler_id_pp_test "defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ < 800")

include("${CMAKE_CURRENT_LIST_DIR}/IBMCPP-CXX-DetermineVersionInternal.cmake")


code: include(Compiler/XL-CXX)


code: include(Compiler/XL-Fortran)


code:
set(_compiler_id_pp_test "defined(__WATCOMC__) && __WATCOMC__ < 1200")

set(_compiler_id_version_compute "
   /* __WATCOMC__ = VVRR */
# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__WATCOMC__ / 100)
# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@((__WATCOMC__ / 10) % 10)
# if (__WATCOMC__ % 10) > 0
#  define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__WATCOMC__ % 10)
# endif")


code:
set(CMAKE_ASM_VERBOSE_FLAG "-V")

# -qthreaded     = Ensures that all optimizations will be thread-safe
# -qhalt=e       = Halt on error messages (rather than just severe errors)
string(APPEND CMAKE_ASM_FLAGS_INIT " -qthreaded -qhalt=e -qsourcetype=assembler")

string(APPEND CMAKE_ASM_FLAGS_DEBUG_INIT " -g")
string(APPEND CMAKE_ASM_FLAGS_RELEASE_INIT " -O -DNDEBUG")
string(APPEND CMAKE_ASM_FLAGS_MINSIZEREL_INIT " -O -DNDEBUG")
string(APPEND CMAKE_ASM_FLAGS_RELWITHDEBINFO_INIT " -g -DNDEBUG")

set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s )