40 lines
1.1 KiB
Plaintext
40 lines
1.1 KiB
Plaintext
# Description: LLVM compiler backend
|
|
# URL: https://llvm.org/
|
|
# Maintainer: CRUX System Team, core-ports at crux dot nu
|
|
# Depends on: cmake libxml2 ninja
|
|
|
|
name=llvm
|
|
version=11.0.0
|
|
release=1
|
|
source=(https://github.com/llvm/llvm-project/releases/download/llvmorg-$version/llvm-$version.src.tar.xz
|
|
llvm-config.h)
|
|
|
|
build() {
|
|
export CC=gcc
|
|
export CXX=g++
|
|
|
|
cmake -S $name-$version.src -B build -G Ninja \
|
|
-D CMAKE_INSTALL_PREFIX=/usr \
|
|
-D CMAKE_BUILD_TYPE=Release \
|
|
-D CMAKE_C_FLAGS_RELEASE="$CFLAGS -DNDEBUG" \
|
|
-D CMAKE_CXX_FLAGS_RELEASE="$CXXFLAGS -DNDEBUG" \
|
|
-D LLVM_TARGETS_TO_BUILD='X86;AMDGPU;BPF' \
|
|
-D LLVM_BUILD_LLVM_DYLIB=1 \
|
|
-D LLVM_LINK_LLVM_DYLIB=1 \
|
|
-D LLVM_PARALLEL_COMPILE_JOBS="${JOBS:-1}" \
|
|
-D LLVM_INCLUDE_EXAMPLES=0 \
|
|
-D LLVM_INCLUDE_TESTS=0 \
|
|
-D LLVM_ENABLE_FFI=1 \
|
|
-D LLVM_ENABLE_RTTI=1 \
|
|
-D LLVM_ENABLE_OCAMLDOC=0 \
|
|
-D LLVM_INSTALL_UTILS=1 \
|
|
-Wno-dev
|
|
|
|
cmake --build build
|
|
DESTDIR=$PKG cmake --install build
|
|
|
|
# multilib stub
|
|
mv $PKG/usr/include/llvm/Config/llvm-config{,-64}.h
|
|
install -m 0644 $SRC/llvm-config.h $PKG/usr/include/llvm/Config/
|
|
}
|