Skip to content

Commit 75c4fd6

Browse files
keith-packardnashif
authored andcommitted
contrib: Add script to build llvm locally
contrib/linux_build_llvm.sh emulates what the CI script does to build llvm. Signed-off-by: Keith Packard <keithp@keithp.com>
1 parent f34209c commit 75c4fd6

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

contrib/linux_build_llvm.sh

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/usr/bin/env bash
2+
3+
# Script to mimic how CI is building llvm toolchain.
4+
5+
# Default is to use current directory as the working directory.
6+
# SDK is under ${WORKING_ROOT_DIR}/sdk-ng/
7+
# Build directory is ${WORKING_ROOT_DIR}/build-workspace/
8+
WORKING_ROOT_DIR="${PWD}"
9+
SDK_DIR="${WORKING_ROOT_DIR}/sdk-ng"
10+
BUILD_DIR="${WORKING_ROOT_DIR}/build-workspace"
11+
12+
pushd "${BUILD_DIR}"
13+
mkdir -p llvm-build
14+
mkdir -p llvm
15+
16+
#TEST=echo
17+
cd llvm-build
18+
$TEST cmake \
19+
-GNinja \
20+
--install-prefix="${BUILD_DIR}"/llvm \
21+
-DLLVM_ENABLE_ZSTD=OFF \
22+
${LLVM_CMAKE_ARGS} \
23+
"${SDK_DIR}"/scripts/llvm || exit 1
24+
25+
# Build LLVM toolchain
26+
$TEST ninja llvm-toolchain || exit 1
27+
28+
# Run LLVM tests
29+
$TEST ninja check-llvm-toolchain || exit 1
30+
31+
# Install LLVM toolchain
32+
$TEST ninja install-llvm-toolchain || exit 1
33+
popd

0 commit comments

Comments
 (0)