From e5d9fce03feeece7f53451da9fb958db2613d31e Mon Sep 17 00:00:00 2001 From: makise-homura Date: Tue, 5 Oct 2021 22:41:02 +0300 Subject: 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. --- Tests/CompileOptions/CMakeLists.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'Tests/CompileOptions') diff --git a/Tests/CompileOptions/CMakeLists.txt b/Tests/CompileOptions/CMakeLists.txt index 1bedac0192..e6db5b7d22 100644 --- a/Tests/CompileOptions/CMakeLists.txt +++ b/Tests/CompileOptions/CMakeLists.txt @@ -30,8 +30,8 @@ endif() set_property(TARGET CompileOptions PROPERTY COMPILE_OPTIONS "-DTEST_DEFINE" "-DNEEDS_ESCAPE=\"E$CAPE\"" - "$<$:-DTEST_DEFINE_GNU>" - "$<$:-DTEST_DEFINE_CXX_AND_GNU>" + "$<$:-DTEST_DEFINE_GNU>" + "$<$:-DTEST_DEFINE_CXX_AND_GNU>" "SHELL:" # produces no options ${c_tests} ${cxx_tests} @@ -49,15 +49,15 @@ else() ) endif() -if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|Borland|Embarcadero" AND NOT "${CMAKE_GENERATOR}" MATCHES "NMake Makefiles") +if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|LCC|Clang|Borland|Embarcadero" AND NOT "${CMAKE_GENERATOR}" MATCHES "NMake Makefiles") set_property(TARGET CompileOptions APPEND PROPERTY COMPILE_OPTIONS "-DTEST_OCTOTHORPE=\"#\"" ) endif() -if(CMAKE_CXX_COMPILER_ID MATCHES "^(GNU|AppleClang|MSVC)$") +if(CMAKE_CXX_COMPILER_ID MATCHES "^(GNU|LCC|AppleClang|MSVC)$") target_compile_definitions(CompileOptions PRIVATE "DO_FLAG_TESTS") - if(CMAKE_CXX_COMPILER_ID MATCHES "^(GNU|AppleClang)$") + if(CMAKE_CXX_COMPILER_ID MATCHES "^(GNU|LCC|AppleClang)$") string(APPEND CMAKE_CXX_FLAGS " -w") endif() string(APPEND CMAKE_CXX_FLAGS " -DFLAG_A=1 -DFLAG_B=1") @@ -79,7 +79,7 @@ endif() target_link_libraries(CompileOptions testlib) -if(CMAKE_CXX_COMPILER_ID MATCHES "GNU") +if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|LCC") target_compile_definitions(CompileOptions PRIVATE "DO_GNU_TESTS" -- cgit v1.2.1