aboutsummaryrefslogtreecommitdiff
path: root/build_odin.sh
diff options
context:
space:
mode:
authorLaytan Laats <laytanlaats@hotmail.com>2024-05-26 20:01:57 +0200
committerLaytan Laats <laytanlaats@hotmail.com>2024-05-26 20:11:07 +0200
commit5027cfb6189879ddd0d5cdaca9280235837ce9a0 (patch)
tree09902f8c44cb8cee146c0879856dcaaa074a5de8 /build_odin.sh
parent856537f0ce11bd0e966fc6647b949fc99373ef29 (diff)
revert `$(llvm-config --bindir)/clang++` to get the cpp compiler
A few reports of either people not having this clang++ or having it but it not finding system headers. On top of that, the reason we added this in the first place was a bug that surfaced on clang-18 which we've since fixed. Order will now be clang++ from path, then the llvm bindir clang++, then an error. This can all still be overwritten with `CXX=blah make` like before.
Diffstat (limited to 'build_odin.sh')
-rwxr-xr-xbuild_odin.sh8
1 files changed, 7 insertions, 1 deletions
diff --git a/build_odin.sh b/build_odin.sh
index c27ad119d..ec65bb49d 100755
--- a/build_odin.sh
+++ b/build_odin.sh
@@ -45,7 +45,13 @@ if [ -z "$LLVM_CONFIG" ]; then
fi
fi
-: ${CXX=$($LLVM_CONFIG --bindir)/clang++}
+if [ -x "$(which clang++)" ]; then
+ : ${CXX="clang++"}
+elif [ -x "$($LLVM_CONFIG --bindir)/clang++" ]; then
+ : ${CXX=$($LLVM_CONFIG --bindir)/clang++}
+else
+ error "No clang++ command found. Set CXX to proceed."
+fi
LLVM_VERSION="$($LLVM_CONFIG --version)"
LLVM_VERSION_MAJOR="$(echo $LLVM_VERSION | awk -F. '{print $1}')"