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. --- CMakeLists.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index fdfe456aa9..62f726d761 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -633,7 +633,7 @@ macro (CMAKE_BUILD_UTILITIES) message(FATAL_ERROR "CMAKE_USE_SYSTEM_JSONCPP is ON but a JsonCpp is not found!") endif() - if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") + if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|LCC|Clang") set_property(TARGET JsonCpp::JsonCpp APPEND PROPERTY INTERFACE_COMPILE_OPTIONS -Wno-deprecated-declarations) endif() @@ -820,7 +820,8 @@ if(NOT CMake_TEST_EXTERNAL_CMAKE) (CMAKE_C_COMPILER_ID STREQUAL "Clang" AND NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS 3.0 AND NOT "x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC") OR - CMAKE_C_COMPILER_ID STREQUAL "AppleClang") + CMAKE_C_COMPILER_ID STREQUAL "AppleClang" OR + CMAKE_C_COMPILER_ID STREQUAL "LCC") set(C_FLAGS_LIST -Wcast-align -Werror-implicit-function-declaration -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -Wmissing-format-attribute -fno-common -Wundef -- cgit v1.2.1