diff options
author | makise-homura <akemi_homura@kurisa.ch> | 2021-10-05 19:41:02 (GMT) |
---|---|---|
committer | makise-homura <akemi_homura@kurisa.ch> | 2021-10-15 02:05:19 (GMT) |
commit | e5d9fce03feeece7f53451da9fb958db2613d31e (patch) | |
tree | a8e5fc2001514dce2f4f390f48f416f650db456e /Tests/ExportImport/Import | |
parent | 2b9ef77944cab3a330fa547dbe7e87aefd80b795 (diff) | |
download | CMake-e5d9fce03feeece7f53451da9fb958db2613d31e.zip CMake-e5d9fce03feeece7f53451da9fb958db2613d31e.tar.gz CMake-e5d9fce03feeece7f53451da9fb958db2613d31e.tar.bz2 |
LCC: Add dedicated support for MCST LCC compiler
Divert LCC compiler as a new one, instead of treating it as GNU.
Since old times, Elbrus C/C++/Fortran Compiler (LCC) by MCST has been
passing checks for GNU compilers, so it has been identified as GNU.
Now, with intent of seriously upstreaming its support, it has been
added as a separate LCC compiler, and its version displays not a
supported GCC version, but LCC version itself (e.g. LCC 1.25.19 instead
of GNU 7.3.0).
This commit adds its support for detection, and also converts basically
every check like 'is this compiler GNU?' to 'is this compiler GNU or
LCC?'. The only places where this check is untouched, is where it
regards other platforms where LCC is unavailable (primarily non-Linux),
and where it REALLY differs from GNU compiler.
Note: this transition may break software that are already ported to
Elbrus, but hardly relies that LCC will be detected as GNU; still such
software is not known.
Diffstat (limited to 'Tests/ExportImport/Import')
-rw-r--r-- | Tests/ExportImport/Import/A/CMakeLists.txt | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Tests/ExportImport/Import/A/CMakeLists.txt b/Tests/ExportImport/Import/A/CMakeLists.txt index 3cb3833..860a0bc 100644 --- a/Tests/ExportImport/Import/A/CMakeLists.txt +++ b/Tests/ExportImport/Import/A/CMakeLists.txt @@ -325,14 +325,14 @@ target_compile_definitions(deps_shared_iface $<$<STREQUAL:$<TARGET_PROPERTY:CUSTOM_STRING>,testcontent>:CUSTOM_STRING_IS_MATCH> ) -if(CMAKE_CXX_COMPILER_ID MATCHES "GNU") +if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "LCC") target_compile_definitions(deps_shared_iface PRIVATE "DO_GNU_TESTS" ) endif() -if (APPLE OR CMAKE_CXX_COMPILER_ID MATCHES "GNU") +if (APPLE OR CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "LCC") include(CheckCXXCompilerFlag) check_cxx_compiler_flag(-fPIE run_pic_test) else() @@ -365,7 +365,7 @@ endif() add_executable(deps_shared_iface2 deps_shared_iface.cpp) target_link_libraries(deps_shared_iface2 bld_testSharedLibDepends bld_subdirlib) -if(CMAKE_CXX_COMPILER_ID MATCHES "GNU") +if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "LCC") target_compile_definitions(deps_shared_iface2 PRIVATE "DO_GNU_TESTS" @@ -413,6 +413,7 @@ endforeach() unset(_configs) if (((CMAKE_C_COMPILER_ID STREQUAL GNU AND CMAKE_C_COMPILER_VERSION VERSION_GREATER 4.4) + OR CMAKE_C_COMPILER_ID MATCHES "LCC" OR (CMAKE_C_COMPILER_ID STREQUAL Clang AND NOT "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC")) AND (CMAKE_GENERATOR STREQUAL "Unix Makefiles" OR CMAKE_GENERATOR STREQUAL "Ninja")) include(CheckCXXCompilerFlag) |