From 1aa497cb7b3d3cb3279a83d50adec9d0e9cf2f92 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Sun, 7 Aug 2022 23:12:10 +0200 Subject: [PATCH] build: Added support for Clang 14.0.0+ --- cmake/build_helpers.cmake | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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()