summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorBrian Gianforcaro <bgianf@serenityos.org>2021-05-31 01:18:22 -0700
committerAli Mohammad Pur <Ali.mpfard@gmail.com>2021-05-31 14:28:50 +0430
commitdc54a0fbd399923ca0c3db1ffd34c63158ecd7d5 (patch)
tree4d8b2d53a4986ac062899862f5e582aa66b58bf8 /CMakeLists.txt
parent0af192ff8d3874a0bd3ee505be5336158326f587 (diff)
downloadserenity-dc54a0fbd399923ca0c3db1ffd34c63158ecd7d5.zip
CMake: Verify the GCC host version is new enough to build serenity
There are lots of people who have issues building serenity because they don't read the build directions closely enough and have an unsupported GCC version as their host compiler. Instead of repeatedly having to answer these kinds of questions, lets just error out upfront.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt6
1 files changed, 6 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5b83d5e257..3c5b4abb28 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -8,6 +8,12 @@ if(NOT "${CMAKE_BUILD_TYPE}" STREQUAL "")
"and that's all there is.")
endif()
+if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 10.2)
+ message(FATAL_ERROR
+ "A GCC version less than 10.2 was detected (${CMAKE_CXX_COMPILER_VERSION}), this is unsupported.\n"
+ "Please re-read the build instructions documentation, and upgrade your host compiler.\n")
+endif()
+
set(CMAKE_INSTALL_MESSAGE NEVER)
enable_testing()