build: Make sure ImHex is being compiled with GCC 12.1.0 or higher

This commit is contained in:
WerWolv
2022-08-02 11:59:29 +02:00
parent 8a02103d5e
commit 69544bdf06
2 changed files with 14 additions and 0 deletions

View File

@@ -309,6 +309,18 @@ function(detectBadClone)
endforeach ()
endfunction()
set(IMHEX_REQUIRED_COMPILER "GNU")
set(IMHEX_MIN_COMPILER_VERSION "12.1.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.")
endif()
endfunction()
macro(setVariableInParent variable value)
get_directory_property(hasParent PARENT_DIRECTORY)