Skip to content

Commit

Permalink
Do not build lld on Windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
elliottslaughter committed Jun 25, 2024
1 parent e56e91f commit 359b93d
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 359b93d

Please sign in to comment.