From 01abc0541a9840b835ed934f4ecac7d1d5a1a650 Mon Sep 17 00:00:00 2001 From: Gabriel Ravier Date: Sun, 27 Oct 2019 21:22:10 +0100 Subject: [PATCH] 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 --- CMakeLists.txt | 2 ++ bin2h/CMakeLists.txt | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 575926a7..f141fb46 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,6 +18,8 @@ set(RENDERER "SDLTexture" CACHE STRING "Which renderer the game should use: 'Ope 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 diff --git a/bin2h/CMakeLists.txt b/bin2h/CMakeLists.txt index 0184f487..757c7ffd 100644 --- a/bin2h/CMakeLists.txt +++ b/bin2h/CMakeLists.txt @@ -14,20 +14,22 @@ set_target_properties(bin2h PROPERTIES 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")