From ef4fb2482179e2d0404f5f8328c670793e65f8da Mon Sep 17 00:00:00 2001 From: Sean Hickey Date: Thu, 9 Sep 2021 21:52:10 -0700 Subject: [PATCH] Add build-clang.sh --- README.md | 1 - build-clang.sh | 19 +++++++++++++++++++ cmake-default.sh | 2 +- 3 files changed, 20 insertions(+), 2 deletions(-) create mode 100755 build-clang.sh diff --git a/README.md b/README.md index 25b9f38..b74d174 100644 --- a/README.md +++ b/README.md @@ -95,4 +95,3 @@ to. It is in the Public Domain. [1]: https://cmake.org/cmake/help/latest/envvar/DESTDIR.html#envvar:DESTDIR -[2]: diff --git a/build-clang.sh b/build-clang.sh new file mode 100755 index 0000000..02a8db0 --- /dev/null +++ b/build-clang.sh @@ -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 diff --git a/cmake-default.sh b/cmake-default.sh index b11fca1..7c150d8 100755 --- a/cmake-default.sh +++ b/cmake-default.sh @@ -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 \