42 lines
1.1 KiB
Bash
Executable File
42 lines
1.1 KiB
Bash
Executable File
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
# llvm prefers an out-of-tree build.
|
|
cd ../build
|
|
|
|
cmake \
|
|
-DCMAKE_BUILD_TYPE=Release \
|
|
-DCMAKE_C_FLAGS_RELEASE_INIT="$SHARED_CFLAGS" \
|
|
-DCMAKE_CXX_FLAGS_RELEASE_INIT="$SHARED_CXXFLAGS" \
|
|
-DCMAKE_EXE_LINKER_FLAGS_RELEASE_INIT="$SHARED_LDFLAGS" \
|
|
-DCMAKE_INSTALL_PREFIX="$PREFIX" \
|
|
-DLLVM_ENABLE_ASSERTIONS=OFF \
|
|
-DLLVM_ENABLE_CXXY1=ON \
|
|
-DLLVM_ENABLE_FFI=ON \
|
|
-DLLVM_ENABLE_PIC=ON \
|
|
-DLLVM_ENABLE_ZLIB=ON \
|
|
-DLLVM_ENABLE_RTTI=ON \
|
|
-DLLVM_ENABLE_LIBCXX=OFF \
|
|
-DLLVM_ENABLE_TERMINFO=ON \
|
|
-DLLVM_ENABLE_SPHINX=OFF \
|
|
-DLLVM_BUILD_DOCS=OFF \
|
|
-DLLVM_BUILD_LLVM_DYLIB=ON \
|
|
-DLLVM_BUILD_EXTERNAL_COMPILER_RT=ON \
|
|
-DLLVM_BUILD_EXAMPLES=OFF \
|
|
-DLLVM_INCLUDE_EXAMPLES=OFF \
|
|
-DLLVM_APPEND_VC_REV=OFF \
|
|
-DLLVM_PARALLEL_COMPILE_JOBS=$(nproc) \
|
|
-DLLVM_PARALLEL_LINK_JOBS=$(nproc) \
|
|
-DLLVM_TARGETS_TO_BUILD="host;AMDGPU;BPF" \
|
|
-DLLVM_TARGET_TRIPLE="$BUILD" \
|
|
-DLLVM_HOST_TRIPLE="$HOST" \
|
|
-G "Unix Makefiles" \
|
|
../src
|
|
|
|
## explanation
|
|
#
|
|
# -DCMAKE_BUILD_TYPE: use all the optimisations.
|
|
#
|
|
# -G: use a unix-style, make-driven build process.
|