diff --git a/build.sh b/build.sh index ac25b95..f414d76 100755 --- a/build.sh +++ b/build.sh @@ -13,14 +13,33 @@ else fi rm llvm-project-$version.src.tar* +cmake_flags=( + -DCMAKE_INSTALL_PREFIX="$PWD/../install" + -DCMAKE_BUILD_TYPE=Release + -DLLVM_ENABLE_TERMINFO=OFF + -DLLVM_ENABLE_LIBEDIT=OFF + -DLLVM_ENABLE_ZLIB=OFF + -DLLVM_ENABLE_ZSTD=OFF + -DLLVM_ENABLE_LIBXML2=OFF + -DLLVM_ENABLE_ASSERTIONS=OFF +) + mkdir build install cd build if [[ $(uname) = MINGW* ]]; then export CMAKE_GENERATOR="Visual Studio 17 2022" export CMAKE_GENERATOR_PLATFORM=x64 export CMAKE_GENERATOR_TOOLSET="host=x64" + cmake_flags+=( + -DLLVM_ENABLE_PROJECTS=clang + ) +else + cmake_flags+=( + -DLLVM_ENABLE_PROJECTS='clang;lld' + -DLLVM_ENABLE_RUNTIMES=libunwind + ) fi -cmake ../llvm-project-$version.src/llvm -DCMAKE_INSTALL_PREFIX=$PWD/../install -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS='clang;lld' -DLLVM_ENABLE_RUNTIMES=libunwind -DLLVM_ENABLE_TERMINFO=OFF -DLLVM_ENABLE_LIBEDIT=OFF -DLLVM_ENABLE_ZLIB=OFF -DLLVM_ENABLE_ZSTD=OFF -DLLVM_ENABLE_LIBXML2=OFF -DLLVM_ENABLE_ASSERTIONS=OFF +cmake ../llvm-project-$version.src/llvm "${cmake_flags[@]}" if [[ $(uname) = MINGW* ]]; then cmake --build . --target INSTALL --config Release -j${threads:-4} else