ref: 01abc0541a9840b835ed934f4ecac7d1d5a1a650
parent: d6ec92cba5885dbca1ad11464e08ce5be74e20af
author: Gabriel Ravier <gabravier@gmail.com>
date: Sun Oct 27 17:22:10 EDT 2019
Added code that prints the compiler ID and fixed bin2h's compiler detection code to use the C compiler ID of the C++ compiler ID (which isn't available then as bin2h is in c) Signed-off-by: Gabriel Ravier <gabravier@gmail.com>
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -18,6 +18,8 @@
project(CSE2 LANGUAGES C CXX)
+message(STATUS "Compiler ID : ${CMAKE_CXX_COMPILER_ID}")
+
# Has to be placed after "project()"
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
# Using Clang (this is a match so that we also get "AppleClang" which is the Apple-provided Clang
--- a/bin2h/CMakeLists.txt
+++ b/bin2h/CMakeLists.txt
@@ -14,20 +14,22 @@
C_EXTENSIONS OFF
)
+message(STATUS "Compiler ID : ${CMAKE_C_COMPILER_ID}")
+
# Has to be placed after "project()"
-if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+if (CMAKE_C_COMPILER_ID MATCHES "Clang")
# Using Clang (this is a match so that we also get "AppleClang" which is the Apple-provided Clang
set(COMPILER_IS_CLANG true)
message(STATUS "Compiling with clang")
endif()
-if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
# Using GCC
set(COMPILER_IS_GCC true)
message(STATUS "Compiling with gcc")
endif()
-if (CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
+if (CMAKE_C_COMPILER_ID STREQUAL "Intel")
# Using Intel C++
set(COMPILER_IS_ICC true)
message(STATUS "Compiling with ICC")
--
⑨