aboutsummaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authortharvik <tharvik@users.noreply.github.com>2019-01-19 16:47:33 +0100
committerAndrew Kelley <andrew@ziglang.org>2019-01-21 15:58:54 -0500
commit3bec3b9f9ba49bbc2e7244737c50bdbaa12a6b14 (patch)
tree8dcc1ae7d4fcc72f6cd28ba5e1f34e69cf183ede /cmake
parentaee973829d7b101d76e94d9aee15b1bef33094c0 (diff)
downloadzig-3bec3b9f9ba49bbc2e7244737c50bdbaa12a6b14.tar.gz
zig-3bec3b9f9ba49bbc2e7244737c50bdbaa12a6b14.zip
llvm-config sanity check
Diffstat (limited to 'cmake')
-rw-r--r--cmake/Findllvm.cmake9
1 files changed, 9 insertions, 0 deletions
diff --git a/cmake/Findllvm.cmake b/cmake/Findllvm.cmake
index b847813682..70d50f9843 100644
--- a/cmake/Findllvm.cmake
+++ b/cmake/Findllvm.cmake
@@ -15,6 +15,15 @@ find_program(LLVM_CONFIG_EXE
"c:/msys64/mingw64/bin"
"C:/Libraries/llvm-7.0.0/bin")
+execute_process(
+ COMMAND ${LLVM_CONFIG_EXE} --version
+ OUTPUT_VARIABLE LLVM_CONFIG_VERSION
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+if(LLVM_CONFIG_VERSION VERSION_LESS 7)
+ message(FATAL_ERROR "expected LLVM version >=7 but found ${LLVM_CONFIG_VERSION}")
+endif()
+
if(NOT(CMAKE_BUILD_TYPE STREQUAL "Debug") OR ZIG_STATIC)
execute_process(
COMMAND ${LLVM_CONFIG_EXE} --libfiles --link-static