Made CMake use a more reliable way for detecting the compiler version.

This commit is contained in:
Leon Styhre 2021-09-19 15:55:47 +02:00
parent 970b7dd63d
commit dacda90186

View file

@ -107,14 +107,12 @@ endif()
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
message("-- Compiler is Clang/LLVM") message("-- Compiler is Clang/LLVM")
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE CLANG_VERSION) if(${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 5.0.0)
if(CLANG_VERSION VERSION_LESS 5.0.0)
message(SEND_ERROR "You need at least Clang 5.0.0 to compile EmulationStation-DE") message(SEND_ERROR "You need at least Clang 5.0.0 to compile EmulationStation-DE")
endif() endif()
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
message("-- Compiler is GNU/GCC") message("-- Compiler is GNU/GCC")
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpfullversion OUTPUT_VARIABLE G++_VERSION) if(${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 7.1)
if(G++_VERSION VERSION_LESS 7.1)
message(SEND_ERROR "You need at least GCC 7.1 to compile EmulationStation-DE") message(SEND_ERROR "You need at least GCC 7.1 to compile EmulationStation-DE")
endif() endif()
if(WIN32) if(WIN32)