diff --git a/cmake/build_helpers.cmake b/cmake/build_helpers.cmake index edaf5164d..c545408c3 100644 --- a/cmake/build_helpers.cmake +++ b/cmake/build_helpers.cmake @@ -324,15 +324,18 @@ function(detectBadClone) endforeach () endfunction() -set(IMHEX_REQUIRED_COMPILER "GNU") set(IMHEX_MIN_COMPILER_VERSION "12.0.0") function(verifyCompiler) if (IMHEX_IGNORE_BAD_COMPILER) return() endif() - if (NOT CMAKE_CXX_COMPILER_ID STREQUAL ${IMHEX_REQUIRED_COMPILER} OR CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${IMHEX_MIN_COMPILER_VERSION}) - message(FATAL_ERROR "ImHex requires GCC ${IMHEX_MIN_COMPILER_VERSION} or newer. Please use the latest GCC version.") + if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "12.0.0") + message(FATAL_ERROR "ImHex requires GCC 12.0.0 or newer. Please use the latest GCC version.") + elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "14.0.0") + message(FATAL_ERROR "ImHex requires Clang 14.0.0 or newer. Please use the latest Clang version.") + elseif (NOT CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + message(FATAL_ERROR "ImHex can only be compiled with GCC or Clang. ${CMAKE_CXX_COMPILER_ID} is not supported.") endif() endfunction()