-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathstage1-clang.sh
More file actions
33 lines (27 loc) · 901 Bytes
/
stage1-clang.sh
File metadata and controls
33 lines (27 loc) · 901 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#/bin/bash
set -e
PROC_NR=$(getconf _NPROCESSORS_ONLN)
REPO_URL="https://github.com/llvm/llvm-project"
REPO_FOLDER="llvm-project"
BRANCH_NAME="llvmorg-14.0.3"
if test ! -d "$REPO_FOLDER"; then
git clone --depth 1 -b $BRANCH_NAME $REPO_URL && cd $REPO_FOLDER || exit 1
else
cd $REPO_FOLDER && git fetch origin && git reset --hard origin/${BRANCH_NAME} || exit 1
fi
cmake \
-G "Unix Makefiles" \
-S llvm -B build \
-DLLVM_TARGETS_TO_BUILD="X86" \
-DLLVM_ENABLE_PROJECTS="clang" \
-DCMAKE_BUILD_TYPE=MinSizeRel \
-DCMAKE_INSTALL_PREFIX=${ORBISDEV}/ \
-DLLVM_DEFAULT_TARGET_TRIPLE=x86_64-scei-ps4 \
|| exit 1
## Enter in build folder
cd build || exit 1
## Compile and install.
make --quiet -j $PROC_NR clean || { exit 1; }
make --quiet -j $PROC_NR || { exit 1; }
make --quiet -j $PROC_NR install || { exit 1; }
make --quiet -j $PROC_NR clean || { exit 1; }