2020-05-22 23:54:28 +02: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
|
2024-10-03 13:50:34 +02:00
|
|
|
git submodule -q update --init --depth 1 $(awk '/path/ && !/llvm/ { print $3 }' .gitmodules)
|
2020-05-22 23:54:28 +02:00
|
|
|
|
2020-12-22 04:37:14 +01:00
|
|
|
# Prefer newer Clang than in base system (see also .ci/install-freebsd.sh)
|
|
|
|
# libc++ isn't in llvm* packages, so download manually
|
2023-04-08 14:21:22 +02:00
|
|
|
fetch https://github.com/llvm/llvm-project/releases/download/llvmorg-16.0.1/llvm-project-16.0.1.src.tar.xz
|
2022-12-08 13:31:58 +01:00
|
|
|
tar xf llvm*.tar.xz
|
2023-03-11 20:08:27 +01:00
|
|
|
export CC=clang16 CXX=clang++16
|
2021-11-30 17:12:37 +01:00
|
|
|
cmake -B libcxx_build -G Ninja -S llvm*/libcxx \
|
|
|
|
-DLLVM_CCACHE_BUILD=ON \
|
2022-12-08 13:31:58 +01:00
|
|
|
-DLIBCXX_INCLUDE_BENCHMARKS=OFF \
|
2021-11-30 17:12:37 +01: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 04:37:14 +01:00
|
|
|
|
2020-05-22 23:54:28 +02:00
|
|
|
CONFIGURE_ARGS="
|
2023-03-11 20:08:27 +01:00
|
|
|
-DWITH_LLVM=ON
|
2022-10-15 21:01:38 +02:00
|
|
|
-DUSE_SDL=OFF
|
2020-05-22 23:54:28 +02:00
|
|
|
-DUSE_PRECOMPILED_HEADERS=OFF
|
|
|
|
-DUSE_NATIVE_INSTRUCTIONS=OFF
|
|
|
|
-DUSE_SYSTEM_FFMPEG=ON
|
|
|
|
-DUSE_SYSTEM_CURL=ON
|
|
|
|
-DUSE_SYSTEM_LIBPNG=ON
|
2024-11-16 11:03:42 +01:00
|
|
|
-DUSE_SYSTEM_OPENCV=ON
|
2020-05-22 23:54:28 +02:00
|
|
|
"
|
|
|
|
|
|
|
|
# shellcheck disable=SC2086
|
|
|
|
cmake -B build -G Ninja $CONFIGURE_ARGS
|
|
|
|
cmake --build build
|
|
|
|
|
2020-07-13 01:15:32 +02:00
|
|
|
ccache --show-stats
|
|
|
|
ccache --zero-stats
|