aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen van Rijn <Kelimion@users.noreply.github.com>2022-10-27 03:08:02 +0200
committerGitHub <noreply@github.com>2022-10-27 03:08:02 +0200
commit662ed4a67c13040bfc5a04fa23731649e4ba93c5 (patch)
treefcac5a865a216349434b9fb1eb2a4f4f441fab74
parent22672a816e8969836530178b7b196e09f5a78344 (diff)
parent85a263130d6161e1ceed1d8d82d4c96cd66e87cc (diff)
Merge pull request #2154 from Kelimion/llvm-15-check
Panic if LLVM > 14.
-rwxr-xr-xbuild_odin.sh12
-rw-r--r--src/main.cpp3
2 files changed, 15 insertions, 0 deletions
diff --git a/build_odin.sh b/build_odin.sh
index f131e088d..5ecb7709a 100755
--- a/build_odin.sh
+++ b/build_odin.sh
@@ -44,6 +44,12 @@ config_darwin() {
fi
fi
+ MAX_LLVM_VERSION=("14.999.999")
+ if [ $(version $($LLVM_CONFIG --version)) -gt $(version $MAX_LLVM_VERSION) ]; then
+ echo "Tried to use " $(which $LLVM_CONFIG) "version" $($LLVM_CONFIG --version)
+ panic "Requirement: llvm-config must be base version smaller than 15"
+ fi
+
LDFLAGS="$LDFLAGS -liconv -ldl"
CXXFLAGS="$CXXFLAGS $($LLVM_CONFIG --cxxflags --ldflags)"
LDFLAGS="$LDFLAGS -lLLVM-C"
@@ -97,6 +103,12 @@ config_linux() {
panic "Requirement: llvm-config must be base version greater than 11"
fi
+ MAX_LLVM_VERSION=("14.999.999")
+ if [ $(version $($LLVM_CONFIG --version)) -gt $(version $MAX_LLVM_VERSION) ]; then
+ echo "Tried to use " $(which $LLVM_CONFIG) "version" $($LLVM_CONFIG --version)
+ panic "Requirement: llvm-config must be base version smaller than 15"
+ fi
+
LDFLAGS="$LDFLAGS -ldl"
CXXFLAGS="$CXXFLAGS $($LLVM_CONFIG --cxxflags --ldflags)"
LDFLAGS="$LDFLAGS $($LLVM_CONFIG --libs core native --system-libs --libfiles) -Wl,-rpath=\$ORIGIN"
diff --git a/src/main.cpp b/src/main.cpp
index a1daa51d1..4c6eaf521 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -53,6 +53,9 @@ gb_global Timings global_timings = {0};
#if LLVM_VERSION_MAJOR < 11
#error LLVM Version 11+ is required => "brew install llvm@11"
#endif
+ #if LLVM_VERSION_MAJOR > 14
+ #error LLVM Version 11..=14 is required => "brew install llvm@14"
+ #endif
#endif
#include "query_data.cpp"