Skip to content

Commit

Permalink
Enable ccache for local/non-docker builds
Browse files Browse the repository at this point in the history
Signed-off-by: Brian Cain <bcain@quicinc.com>
  • Loading branch information
androm3da committed Nov 7, 2023
1 parent 8a8923b commit 22dd6de
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ ADD get-src-tarballs.sh /root/hexagon-toolchain/get-src-tarballs.sh
ADD *.cmake /root/hexagon-toolchain/
RUN cd /root/hexagon-toolchain && ./get-src-tarballs.sh ${PWD} ${TOOLCHAIN_INSTALL}/manifest

ENV IN_CONTAINER 1
ARG ARTIFACT_TAG=${VER}
ADD build-toolchain.sh /root/hexagon-toolchain/build-toolchain.sh
RUN cd /root/hexagon-toolchain && ./build-toolchain.sh ${ARTIFACT_TAG}
Expand Down
11 changes: 9 additions & 2 deletions build-toolchain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,17 @@ build_llvm_clang_cross() {
if [[ "${triple}" =~ "windows" ]]; then
EXTRA="-C windows-gnu-target.cmake"
fi
if [[ "${IN_CONTAINER-0}" -ne 1 ]]; then
CMAKE_CCACHE="-DLLVM_CCACHE_BUILD:BOOL=ON"
fi

CC="zig cc --target=${triple}" \
ASM="zig cc --target=${triple}" \
CXX="zig c++ --target=${triple}" \
cmake -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX:PATH=${TOOLCHAIN_INSTALL}/${triple}/ \
-DLLVM_CCACHE_BUILD:BOOL=OFF \
${CMAKE_CCACHE-} \
-DLLVM_ENABLE_TERMINFO:BOOL=OFF \
-DLLVM_ENABLE_ASSERTIONS:BOOL=ON \
-DLLVM_HOST_TRIPLE=${triple} \
Expand All @@ -46,11 +49,15 @@ build_llvm_clang_cross() {

build_llvm_clang() {
cd ${BASE}
if [[ "${IN_CONTAINER-0}" -ne 1 ]]; then
CMAKE_CCACHE="-DLLVM_CCACHE_BUILD:BOOL=ON"
fi


CC=clang CXX=clang++ cmake -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX:PATH=${TOOLCHAIN_INSTALL}/x86_64-linux-gnu/ \
-DLLVM_CCACHE_BUILD:BOOL=OFF \
${CMAKE_CCACHE-} \
-DLLVM_ENABLE_LLD:BOOL=ON \
-DLLVM_ENABLE_LIBCXX:BOOL=ON \
-DLLVM_ENABLE_TERMINFO:BOOL=OFF \
Expand Down

0 comments on commit 22dd6de

Please sign in to comment.