From e90b6bb1e937016c9e7b66db62575caade66e9b4 Mon Sep 17 00:00:00 2001 From: Victor Perevertkin Date: Tue, 20 Aug 2019 01:07:45 +0300 Subject: [PATCH] [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.") -- 2.17.1