https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e90b6bb1e937016c9e7b6…
commit e90b6bb1e937016c9e7b66db62575caade66e9b4
Author: Victor Perevertkin <victor(a)perevertkin.ru>
AuthorDate: Tue Aug 20 01:07:45 2019 +0300
Commit: Victor Perevertkin <victor(a)perevertkin.ru>
CommitDate: Tue Aug 20 15:05:47 2019 +0200
[CMAKE] Define GCC and CLANG cmake variables
---
sdk/cmake/config.cmake | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/sdk/cmake/config.cmake b/sdk/cmake/config.cmake
index 7b296996adc..d3f596f3168 100644
--- a/sdk/cmake/config.cmake
+++ b/sdk/cmake/config.cmake
@@ -36,6 +36,20 @@ else()
"Whether to compile for debugging.")
endif()
+if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
+ set(GCC TRUE CACHE BOOL "The compiler is GCC")
+ set(CLANG FALSE CACHE BOOL "The compiler is LLVM Clang")
+elseif(CMAKE_C_COMPILER_ID STREQUAL "Clang")
+ set(GCC FALSE CACHE BOOL "The compiler is GCC")
+ set(CLANG TRUE CACHE BOOL "The compiler is LLVM Clang")
+elseif(MSVC) # aka CMAKE_C_COMPILER_ID STEQUAL "MSVC"
+ set(GCC FALSE CACHE BOOL "The compiler is GCC")
+ set(CLANG FALSE CACHE BOOL "The compiler is LLVM Clang")
+ # MSVC variable is already set by cmake
+else()
+ message("WARNING: the compiler has not been recognized")
+endif()
+
if(MSVC AND (NOT USE_CLANG_CL))
set(KDBG FALSE CACHE BOOL
"Whether to compile in the integrated kernel debugger.")