1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-19 08:30:25 +02:00

fix the linux building

This commit is contained in:
M0N7Y5 2025-01-30 14:46:31 +01:00
parent 439ae8d3c4
commit a012f8572e

View file

@ -43,8 +43,11 @@ else
echo "Ninja isn't installed, consider installing it for faster build speeds." echo "Ninja isn't installed, consider installing it for faster build speeds."
fi fi
LLVM_CONFIG=$(command -v llvm-config-18 2>/dev/null || command -v llvm-config 2>/dev/null) LLVM_CONFIG=$(command -v llvm-config-18 2>/dev/null ||
command -v /usr/lib/llvm18/bin/llvm-config 2>/dev/null ||
command -v llvm-config 2>/dev/null)
LLVM_FOUND=0 LLVM_FOUND=0
LLVM_DIR=""
if [ -n "$LLVM_CONFIG" ]; then if [ -n "$LLVM_CONFIG" ]; then
LLVM_VERSION=$($LLVM_CONFIG --version) LLVM_VERSION=$($LLVM_CONFIG --version)
@ -52,6 +55,22 @@ if [ -n "$LLVM_CONFIG" ]; then
LLVM_MINOR_VERSION=$(echo "$LLVM_VERSION" | cut -d. -f2) LLVM_MINOR_VERSION=$(echo "$LLVM_VERSION" | cut -d. -f2)
if [ "$LLVM_MAJOR_VERSION" = "18" ] && [ "$LLVM_MINOR_VERSION" = "1" ]; then if [ "$LLVM_MAJOR_VERSION" = "18" ] && [ "$LLVM_MINOR_VERSION" = "1" ]; then
LLVM_FOUND=1 LLVM_FOUND=1
# Get the LLVM prefix directory and construct cmake path from it
LLVM_PREFIX=$($LLVM_CONFIG --prefix)
LLVM_DIR="$LLVM_PREFIX/lib/cmake/llvm"
else
# If first attempt didn't find 18.1, explicitly try the llvm18 path
LLVM_CONFIG="/usr/lib/llvm18/bin/llvm-config"
if [ -x "$LLVM_CONFIG" ]; then
LLVM_VERSION=$($LLVM_CONFIG --version)
LLVM_MAJOR_VERSION=$(echo "$LLVM_VERSION" | cut -d. -f1)
LLVM_MINOR_VERSION=$(echo "$LLVM_VERSION" | cut -d. -f2)
if [ "$LLVM_MAJOR_VERSION" = "18" ] && [ "$LLVM_MINOR_VERSION" = "1" ]; then
LLVM_FOUND=1
LLVM_PREFIX=$($LLVM_CONFIG --prefix)
LLVM_DIR="$LLVM_PREFIX/lib/cmake/llvm"
fi
fi
fi fi
fi fi
@ -83,12 +102,12 @@ fi
cd jbuild_d cd jbuild_d
echo cmake $USE_NINJA $USE_SDL -DCMAKE_BUILD_TYPE=Debug ../ echo cmake -DLLVM_DIR="$LLVM_DIR" $USE_NINJA $USE_SDL -DCMAKE_BUILD_TYPE=Debug ../
cmake $USE_NINJA $USE_SDL $USE_FFI -DCMAKE_BUILD_TYPE=Debug ../ cmake -DLLVM_DIR="$LLVM_DIR" $USE_NINJA $USE_SDL $USE_FFI -DCMAKE_BUILD_TYPE=Debug ../
cmake --build . cmake --build .
cd ../jbuild cd ../jbuild
cmake $USE_NINJA $USE_SDL $USE_FFI -DCMAKE_BUILD_TYPE=RelWithDebInfo ../ cmake -DLLVM_DIR="$LLVM_DIR" $USE_NINJA $USE_SDL $USE_FFI -DCMAKE_BUILD_TYPE=RelWithDebInfo ../
cmake --build . cmake --build .
cd ../IDE/dist cd ../IDE/dist