2020-05-22 21:54:28 +00:00
|
|
|
#!/bin/sh -ex
|
|
|
|
|
|
|
|
# Pull all the submodules except llvm
|
|
|
|
# Note: Tried to use git submodule status, but it takes over 20 seconds
|
|
|
|
# shellcheck disable=SC2046
|
2020-07-12 23:20:09 +00:00
|
|
|
git submodule -q update --init --depth 1 $(awk '/path/ && !/llvm/ { print $3 }' .gitmodules)
|
2020-05-22 21:54:28 +00:00
|
|
|
|
2020-12-22 03:37:14 +00:00
|
|
|
# Prefer newer Clang than in base system (see also .ci/install-freebsd.sh)
|
|
|
|
# libc++ isn't in llvm* packages, so download manually
|
2023-03-11 19:08:27 +00:00
|
|
|
fetch https://github.com/llvm/llvm-project/releases/download/llvmorg-16.0.0/llvm-project-16.0.0.src.tar.xz
|
2022-12-08 12:31:58 +00:00
|
|
|
tar xf llvm*.tar.xz
|
2023-03-11 19:08:27 +00:00
|
|
|
export CC=clang16 CXX=clang++16
|
2021-11-30 16:12:37 +00:00
|
|
|
cmake -B libcxx_build -G Ninja -S llvm*/libcxx \
|
|
|
|
-DLLVM_CCACHE_BUILD=ON \
|
2022-12-08 12:31:58 +00:00
|
|
|
-DLIBCXX_INCLUDE_BENCHMARKS=OFF \
|
2021-11-30 16:12:37 +00:00
|
|
|
-DCMAKE_INSTALL_PREFIX:PATH=libcxx_prefix
|
|
|
|
cmake --build libcxx_build
|
|
|
|
cmake --install libcxx_build
|
|
|
|
export CXXFLAGS="$CXXFLAGS -nostdinc++ -isystem$PWD/libcxx_prefix/include/c++/v1"
|
|
|
|
export LDFLAGS="$LDFLAGS -nostdlib++ -L$PWD/libcxx_prefix/lib -l:libc++.a -lcxxrt"
|
2020-12-22 03:37:14 +00:00
|
|
|
|
2020-05-22 21:54:28 +00:00
|
|
|
CONFIGURE_ARGS="
|
2023-03-11 19:08:27 +00:00
|
|
|
-DWITH_LLVM=ON
|
2022-10-15 19:01:38 +00:00
|
|
|
-DUSE_SDL=OFF
|
2020-05-22 21:54:28 +00:00
|
|
|
-DUSE_PRECOMPILED_HEADERS=OFF
|
|
|
|
-DUSE_NATIVE_INSTRUCTIONS=OFF
|
|
|
|
-DUSE_SYSTEM_FFMPEG=ON
|
|
|
|
-DUSE_SYSTEM_CURL=ON
|
|
|
|
-DUSE_SYSTEM_LIBPNG=ON
|
|
|
|
"
|
|
|
|
|
|
|
|
# shellcheck disable=SC2086
|
|
|
|
cmake -B build -G Ninja $CONFIGURE_ARGS
|
|
|
|
cmake --build build
|
|
|
|
|
2020-07-12 23:15:32 +00:00
|
|
|
ccache --show-stats
|
|
|
|
ccache --zero-stats
|