From e5dd69110e6f3e13b670aece5029c33e54e12f70 Mon Sep 17 00:00:00 2001 From: Ruizhe Zhao Date: Mon, 13 Sep 2021 16:27:08 +0100 Subject: [PATCH] Don't cmake if it has been built --- scripts/build-llvm.sh | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/scripts/build-llvm.sh b/scripts/build-llvm.sh index 32d00c4bb71..214c1d0f27e 100755 --- a/scripts/build-llvm.sh +++ b/scripts/build-llvm.sh @@ -36,21 +36,23 @@ mkdir -p build cd build # Configure CMake -export CC=gcc -export CXX=g++ -cmake ../llvm \ - -DLLVM_ENABLE_PROJECTS="mlir;llvm;clang" \ - -DCMAKE_BUILD_TYPE=RELEASE \ - -DLLVM_BUILD_EXAMPLES=OFF \ - -DLLVM_TARGETS_TO_BUILD="host" \ - -DLLVM_OPTIMIZED_TABLEGEN=ON \ - -DLLVM_ENABLE_OCAMLDOC=OFF \ - -DLLVM_ENABLE_BINDINGS=OFF \ - -DLLVM_INSTALL_UTILS=ON \ - -DLLVM_ENABLE_ASSERTIONS=ON \ - -DBUILD_POLYMER=ON \ - -DPLUTO_LIBCLANG_PREFIX="$(llvm-config --prefix)" \ - -G "${CMAKE_GENERATOR}" +if [ ! -f "CMakeCache.txt" ]; then + export CC=gcc + export CXX=g++ + cmake ../llvm \ + -DLLVM_ENABLE_PROJECTS="mlir;llvm;clang" \ + -DCMAKE_BUILD_TYPE=RELEASE \ + -DLLVM_BUILD_EXAMPLES=OFF \ + -DLLVM_TARGETS_TO_BUILD="host" \ + -DLLVM_OPTIMIZED_TABLEGEN=ON \ + -DLLVM_ENABLE_OCAMLDOC=OFF \ + -DLLVM_ENABLE_BINDINGS=OFF \ + -DLLVM_INSTALL_UTILS=ON \ + -DLLVM_ENABLE_ASSERTIONS=ON \ + -DBUILD_POLYMER=ON \ + -DPLUTO_LIBCLANG_PREFIX="$(llvm-config --prefix)" \ + -G "${CMAKE_GENERATOR}" +fi # Run building cmake --build . --target all -- -j "$(nproc)"