Meta: Re-enable toolchain version checks

These were removed in the Superbuild conversion. Re-add the checks that
make sure that if there's a toolchain update, developers re-build their
toolchain.
This commit is contained in:
Andrew Kaster 2022-01-03 01:26:13 -07:00 committed by Brian Gianforcaro
parent 170a7e263c
commit ba2ca54660
Notes: sideshowbarker 2024-07-17 21:43:24 +09:00

View file

@ -16,6 +16,20 @@ if(NOT CMAKE_SYSTEM_NAME STREQUAL "SerenityOS")
"Please re-read the BuildInstructions documentation, and use the superbuild configuration\n")
endif()
# Check for toolchain mismatch, user might need to rebuild toolchain
set(GCC_VERSION "11.2.0")
set(LLVM_VERSION "13.0.0")
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(EXPECTED_COMPILER_VERSION "${GCC_VERSION}")
else()
set(EXPECTED_COMPILER_VERSION "${LLVM_VERSION}")
endif()
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL "${EXPECTED_COMPILER_VERSION}")
message(FATAL_ERROR "${CMAKE_CXX_COMPILER_ID} version (${CMAKE_CXX_COMPILER_VERSION}) does not match "
"expected compiler version (${EXPECTED_COMPILER_VERSION}).\n"
"Please rebuild the ${CMAKE_CXX_COMPILER_ID} Toolchain\n")
endif()
set(CMAKE_INSTALL_MESSAGE NEVER)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)