summaryrefslogtreecommitdiff
path: root/Utilities/cmlibuv
diff options
context:
space:
mode:
authormakise-homura <akemi_homura@kurisa.ch>2021-10-05 22:41:02 +0300
committermakise-homura <akemi_homura@kurisa.ch>2021-10-15 05:05:19 +0300
commite5d9fce03feeece7f53451da9fb958db2613d31e (patch)
treea8e5fc2001514dce2f4f390f48f416f650db456e /Utilities/cmlibuv
parent2b9ef77944cab3a330fa547dbe7e87aefd80b795 (diff)
downloadcmake-e5d9fce03feeece7f53451da9fb958db2613d31e.tar.gz
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 'Utilities/cmlibuv')
-rw-r--r--Utilities/cmlibuv/CMakeLists.txt2
-rw-r--r--Utilities/cmlibuv/src/uv-common.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/Utilities/cmlibuv/CMakeLists.txt b/Utilities/cmlibuv/CMakeLists.txt
index 086345c8b9..aabd01320f 100644
--- a/Utilities/cmlibuv/CMakeLists.txt
+++ b/Utilities/cmlibuv/CMakeLists.txt
@@ -2,7 +2,7 @@ project(libuv C)
# Disable warnings to avoid changing 3rd party code.
if(CMAKE_C_COMPILER_ID MATCHES
- "^(GNU|Clang|AppleClang|XLClang|XL|VisualAge|SunPro|HP|Intel|IntelLLVM|NVHPC)$")
+ "^(GNU|LCC|Clang|AppleClang|XLClang|XL|VisualAge|SunPro|HP|Intel|IntelLLVM|NVHPC)$")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w")
elseif(CMAKE_C_COMPILER_ID STREQUAL "PathScale")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -woffall")
diff --git a/Utilities/cmlibuv/src/uv-common.c b/Utilities/cmlibuv/src/uv-common.c
index f986d75270..213c7c638b 100644
--- a/Utilities/cmlibuv/src/uv-common.c
+++ b/Utilities/cmlibuv/src/uv-common.c
@@ -855,7 +855,7 @@ void uv_free_cpu_info(uv_cpu_info_t* cpu_infos, int count) {
}
-#ifdef __GNUC__ /* Also covers __clang__ and __INTEL_COMPILER. */
+#ifdef __GNUC__ /* Also covers __clang__, __LCC__, and __INTEL_COMPILER. */
__attribute__((destructor))
#endif
void uv_library_shutdown(void) {