1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 19:48:20 +02:00
Beef/extern/llvm_build.sh

42 lines
1.3 KiB
Bash
Raw Normal View History

2019-08-23 11:56:54 -07:00
#!/bin/bash
set -e
2020-10-28 09:34:23 -07:00
if [ ! -d llvm-project_11_0_0 ]; then
if [ -f llvm-11.0.0.src.tar.xz ]; then # if user downloaded llvm-11.0.0.src.tar.xz then use it instead
tar -xf llvm-11.0.0.src.tar.xz
mkdir llvm-project_11_0_0
mv llvm-11.0.0.src llvm-project_11_0_0/llvm
else # shallow git clone llvm repo if llvm-11.0.0.src.tar.xz does not exists
git clone --depth 1 --branch llvmorg-11.0.0 https://github.com/llvm/llvm-project.git llvm-project_11_0_0
fi
fi #end if llvm-project_11_0_0 exists
2019-08-23 11:56:54 -07:00
2020-10-28 09:34:23 -07:00
if [ ! -d llvm_linux_11_0_0 ]; then
mkdir llvm_linux_11_0_0
2020-05-21 09:20:58 -07:00
fi
2020-10-28 09:34:23 -07:00
if [ ! -d llvm_linux_11_0_0/bin ]; then
cd llvm_linux_11_0_0
cmake ../llvm-project_11_0_0/llvm -DLLVM_TARGETS_TO_BUILD="AArch64;ARM;X86;WebAssembly" -DCMAKE_BUILD_TYPE:String="Debug"
cmake --build . -t $(cat ../llvm_targets.txt)
2019-08-23 11:56:54 -07:00
cd ..
fi
2020-10-28 09:34:23 -07:00
if [ ! -d llvm_linux_rel_11_0_0 ]; then
mkdir llvm_linux_rel_11_0_0
2020-05-21 09:20:58 -07:00
fi
2020-10-28 09:34:23 -07:00
if [ ! -d llvm_linux_rel_11_0_0/bin ]; then
cd llvm_linux_rel_11_0_0
cmake ../llvm-project_11_0_0/llvm -DLLVM_TARGETS_TO_BUILD="AArch64;ARM;X86;WebAssembly" -DCMAKE_BUILD_TYPE:String="Release"
cmake --build . -t $(cat ../llvm_targets.txt)
2019-08-23 11:56:54 -07:00
cd ..
fi
2019-10-29 05:01:04 -07:00
if [ ! -d ../IDE/dist/llvm/bin ]; then
mkdir ../IDE/dist/llvm
mkdir ../IDE/dist/llvm/bin
fi
cp llvm_linux_rel_11_0_0/bin/llvm-ar ../IDE/dist/llvm/bin