blob: e75cb233243b92673efbdcbc3ed69635eb7cbecf (
plain)
1 # Description: clang compiler
2 # URL: https://clang.llvm.org/
3 # Maintainer: CRUX System Team, core-ports at crux dot nu
4 # Depends on: compiler-rt llvm
5
6 name=clang
7 version=11.0.1
8 release=1
9 source=(https://github.com/llvm/llvm-project/releases/download/llvmorg-$version/$name-$version.src.tar.xz
10 https://github.com/llvm/llvm-project/releases/download/llvmorg-$version/$name-tools-extra-$version.src.tar.xz)
11
12 build() {
13 mv $name-tools-extra-$version.src $name-$version.src/tools/extra
14
15 cmake -S $name-$version.src -B build -G Ninja \
16 -D CMAKE_INSTALL_PREFIX=/usr \
17 -D CMAKE_BUILD_TYPE=Release \
18 -D CMAKE_C_FLAGS_RELEASE="$CFLAGS" \
19 -D CMAKE_CXX_FLAGS_RELEASE="$CXXFLAGS" \
20 -D LLVM_TARGETS_TO_BUILD='X86;AMDGPU;BPF;NVPTX' \
21 -D LLVM_INCLUDE_TESTS=0 \
22 -D LLVM_PARALLEL_COMPILE_JOBS="${JOBS:-1}" \
23 -Wno-dev
24 cmake --build build
25 DESTDIR=$PKG cmake --install build
26
27 # -DCMAKE_INSTALL_LIBEXECDIR is hardcoded..
28 mv $PKG/usr/libexec/{c++-analyzer,ccc-analyzer} $PKG/usr/lib/clang
29 rmdir $PKG/usr/libexec
30 sed -i 's|libexec|lib/clang|' $PKG/usr/bin/scan-build
31 }
|