-
Notifications
You must be signed in to change notification settings - Fork 6
/
measure_build.bash
executable file
·34 lines (26 loc) · 1.07 KB
/
measure_build.bash
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
34
#!/bin/bash
TOPLEV=~/toolchain/llvm
# Change your compiler PATH here to compare them
COMPIlER_PATH=${TOPLEV}/stage2-prof-use-lto/install/bin
cd ${TOPLEV} || (echo "Could not enter ${TOPLEV} directory"; exit 1)
mkdir -p measure-build-time || (echo "Could not create build-directory!"; exit 1)
cd measure-build-time
echo "== Clean old build-artifacts"
rm -r *
echo "== Configure reference Clang-build with tools from ${CPATH}"
cmake -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX="$(pwd)/install" \
-DCMAKE_AR=${COMPIlER_PATH}/llvm-ar \
-DCMAKE_C_COMPILER=${COMPIlER_PATH}/clang \
-DCMAKE_CXX_COMPILER=${COMPIlER_PATH}/clang++ \
-DLLVM_USE_LINKER=${COMPIlER_PATH}/ld.lld \
-DCMAKE_RANLIB=${COMPIlER_PATH}/llvm-ranlib \
-DLLVM_TARGETS_TO_BUILD="X86" \
-DLLVM_ENABLE_PROJECTS="clang" \
-DLLVM_PARALLEL_COMPILE_JOBS="$(nproc)"\
-DLLVM_PARALLEL_LINK_JOBS="$(nproc)" \
../llvm-project/llvm || (echo "Could not configure project!"; exit 1)
echo
echo "== Start Build"
time ninja clang || (echo "Could not build project!"; exit 1)