Build: Add support for compiler detection
Using this system we can separate settings for different compilers nicely.
This commit is contained in:
parent
36253048f5
commit
407ea70991
|
@ -33,3 +33,12 @@ if(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
|||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
message(STATUS "Detected compiler: ${CMAKE_C_COMPILER}")
|
||||
if(CMAKE_C_COMPILER MATCHES "gcc" OR CMAKE_C_COMPILER_ID STREQUAL "GNU")
|
||||
include(${CMAKE_SOURCE_DIR}/cmake/compiler/gcc/settings.cmake)
|
||||
elseif(CMAKE_C_COMPILER MATCHES "clang" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
include(${CMAKE_SOURCE_DIR}/cmake/compiler/clang/settings.cmake)
|
||||
else()
|
||||
message(FATAL_ERROR "No supported compiler found")
|
||||
endif()
|
||||
|
|
Loading…
Reference in New Issue