Check C and C++ compiler separately

It's possible (however unlikely) that the C++ compiler might be clang
but the C compiler might not be.
This commit is contained in:
Ryan Schmidt 2022-11-17 23:56:14 -06:00 committed by GitHub
parent 022d4cffe9
commit 0d38caf2fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,8 +10,12 @@ set(CMAKE_C_STANDARD_REQUIRED TRUE)
set(CMAKE_C_EXTENSIONS FALSE)
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
# Clang or AppleClang
set(CMAKE_CXX_FLAGS "-Wall")
endif()
if ("${CMAKE_C_COMPILER_ID}" MATCHES "Clang")
# Clang or AppleClang
set(CMAKE_CXX_FLAGS "-Wall")
set(CMAKE_C_FLAGS "-Wall")
endif()