aboutsummaryrefslogtreecommitdiff
path: root/cmake/compiler/clang
diff options
context:
space:
mode:
authorTreeston <treeston.mmoc@gmail.com>2020-08-24 17:44:38 +0200
committerGitHub <noreply@github.com>2020-08-24 17:44:38 +0200
commit27b1930d97d541c241655d8b820cbaebe6eec44e (patch)
tree63c7102ea874f10f4c36b3b1da25fa28368d9c33 /cmake/compiler/clang
parentfd05a353418e1be8f4d5194fd2222de7f3955241 (diff)
Build: Add Clang version guard to CMake (PR #25324)
Diffstat (limited to 'cmake/compiler/clang')
-rw-r--r--cmake/compiler/clang/settings.cmake8
1 files changed, 8 insertions, 0 deletions
diff --git a/cmake/compiler/clang/settings.cmake b/cmake/compiler/clang/settings.cmake
index 959f954041e..780aec48cbd 100644
--- a/cmake/compiler/clang/settings.cmake
+++ b/cmake/compiler/clang/settings.cmake
@@ -3,6 +3,14 @@ target_compile_definitions(trinity-compile-option-interface
INTERFACE
-D_BUILD_DIRECTIVE="$<CONFIG>")
+set(CLANG_EXPECTED_VERSION 7.0.0)
+
+if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS CLANG_EXPECTED_VERSION)
+ message(FATAL_ERROR "Clang: TrinityCore requires version ${CLANG_EXPECTED_VERSION} to build but found ${CMAKE_CXX_COMPILER_VERSION}")
+else()
+ message(STATUS "Clang: Minimum version required is ${CLANG_EXPECTED_VERSION}, found ${CMAKE_CXX_COMPILER_VERSION} - ok!")
+endif()
+
if(WITH_WARNINGS)
target_compile_options(trinity-warning-interface
INTERFACE