Add build-clang.sh

main
Sean Hickey 2021-09-09 21:52:10 -07:00
parent 3718ad90e9
commit ef4fb24821
3 changed files with 20 additions and 2 deletions

View File

@ -95,4 +95,3 @@ to. It is in the Public Domain.
[1]: https://cmake.org/cmake/help/latest/envvar/DESTDIR.html#envvar:DESTDIR
[2]:

19
build-clang.sh Executable file
View File

@ -0,0 +1,19 @@
#!/usr/bin/env sh
# Build Clang from source.
# Run this from within the llvm-project directory
# https://llvm.org/docs/CMake.html
# From their wiki, potential values for Projects includes
# clang;clang-tools-extra;compiler-rt;cross-project-tests;libc;libclc;libcxx;libcxxabi;libunwind;lld;lldb;openmp;parallel-libs;polly;pstl
INSTALL_DIR=$HOME/usr/local
mkdir -p $INSTALL_DIR
cmake -S llvm -B build -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=$INSTALL_DIR \
-DLLVM_ENABLE_PROJECS="llvm;clang;openmp"
cd build
ninja

View File

@ -6,7 +6,7 @@ mkdir build
cd build
# Source common settings
. $HOME/usr/local/share/config.site
#. $HOME/usr/local/share/config.site
# Configure
cmake .. -G Ninja \