build: use ccache correctly in the macOS builder

Make compiler symlinks in the macOS builder instead of prepending
`ccache` to the compiler in the CC/CXX environment variables.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
This commit is contained in:
Rafael Kitover 2024-09-14 07:53:34 +00:00
parent 3eea90afb6
commit d337688fa7
No known key found for this signature in database
GPG Key ID: 08AB596679D86240
1 changed files with 9 additions and 2 deletions

View File

@ -34,8 +34,6 @@ case "\$CC" in
CMAKE_REQUIRED_ARGS="\$CMAKE_REQUIRED_ARGS -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER=\$CC -DCMAKE_CXX_COMPILER=\$CXX" CMAKE_REQUIRED_ARGS="\$CMAKE_REQUIRED_ARGS -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER=\$CC -DCMAKE_CXX_COMPILER=\$CXX"
;; ;;
esac esac
export CC="ccache \$CC"
export CXX="ccache \$CXX"
fi fi
;; ;;
esac esac
@ -294,6 +292,7 @@ DIST_PRE_BUILD="$DIST_PRE_BUILD
DIST_POST_BUILD="$DIST_POST_BUILD DIST_POST_BUILD="$DIST_POST_BUILD
pkgconf ln -sf \"\$BUILD_ROOT/root/bin/pkgconf\" \"\$BUILD_ROOT/root/bin/pkg-config\"; pkgconf ln -sf \"\$BUILD_ROOT/root/bin/pkgconf\" \"\$BUILD_ROOT/root/bin/pkg-config\";
ccache setup_ccache
harfbuzz rebuild_dist freetype -Dharfbuzz=enabled; harfbuzz rebuild_dist freetype -Dharfbuzz=enabled;
flex-2.6.3 build_dist flex || :; flex-2.6.3 build_dist flex || :;
libtool ln -sf \"\$BUILD_ROOT/root/bin/libtoolize\" \"\$BUILD_ROOT/root/bin/glibtoolize\"; libtool ln -sf \"\$BUILD_ROOT/root/bin/libtoolize\" \"\$BUILD_ROOT/root/bin/glibtoolize\";
@ -445,6 +444,7 @@ builder() {
install_core_deps install_core_deps
setup_perl setup_perl
setup_meson setup_meson
setup_ccache
setup_ninja setup_ninja
delete_outdated_dists delete_outdated_dists
pre_build_all pre_build_all
@ -623,6 +623,13 @@ setup_meson() {
fi fi
} }
setup_ccache() {
if command -v ccache >/dev/null; then
ln -sf "$(command -v ccache)" "$BUILD_ROOT/root/bin/${CC##*/}"
ln -sf "$(command -v ccache)" "$BUILD_ROOT/root/bin/${CXX##*/}"
fi
}
setup_ninja() { setup_ninja() {
if [ -x /usr/local/bin/ninja ]; then if [ -x /usr/local/bin/ninja ]; then
ninja=/usr/local/bin/ninja ninja=/usr/local/bin/ninja