fix(cmake): Check compiler version
This commit is contained in:
parent
4b7bd7bcb6
commit
e9d88d3173
@ -32,11 +32,19 @@ set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -s")
|
|||||||
|
|
||||||
# Check compiler
|
# Check compiler
|
||||||
if(${CMAKE_CXX_COMPILER_ID} STREQUAL Clang)
|
if(${CMAKE_CXX_COMPILER_ID} STREQUAL Clang)
|
||||||
message_colored(STATUS "Using supported compiler ${CMAKE_CXX_COMPILER_ID}" 32)
|
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.4.0")
|
||||||
|
message_colored(FATAL_ERROR "Compiler not supported (Requires clang-3.4+ or gcc-5.1+)" 31)
|
||||||
|
else()
|
||||||
|
message_colored(STATUS "Using supported compiler ${CMAKE_CXX_COMPILER_ID}-${CMAKE_CXX_COMPILER_VERSION}" 32)
|
||||||
|
endif()
|
||||||
elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL GNU)
|
elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL GNU)
|
||||||
message_colored(STATUS "Using supported compiler ${CMAKE_CXX_COMPILER_ID}" 32)
|
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "5.1.0")
|
||||||
|
message_colored(FATAL_ERROR "Compiler not supported (Requires clang-3.4+ or gcc-5.1+)" 31)
|
||||||
|
else()
|
||||||
|
message_colored(STATUS "Using supported compiler ${CMAKE_CXX_COMPILER_ID}-${CMAKE_CXX_COMPILER_VERSION}" 32)
|
||||||
|
endif()
|
||||||
else()
|
else()
|
||||||
message_colored(WARNING "Using unsupported compiler ${CMAKE_CXX_COMPILER_ID} !" 31)
|
message_colored(WARNING "Using unsupported compiler ${CMAKE_CXX_COMPILER_ID}-${CMAKE_CXX_COMPILER_VERSION} !" 31)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Set compiler and linker flags for preferred C++ library
|
# Set compiler and linker flags for preferred C++ library
|
||||||
|
Loading…
Reference in New Issue
Block a user