mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 23:20:20 +00:00
Ports: Use $arch-serenity-pc-clang{++} for CC and CXX
This lets us eliminate the extra arguments on CC and CXX for ports that care about CC and CXX pointing to actual filenames they can invoke realpath or basename on.
This commit is contained in:
parent
8c877664f7
commit
ad0a001f0a
Notes:
sideshowbarker
2024-07-17 10:05:10 +09:00
Author: https://github.com/ADKaster Commit: https://github.com/SerenityOS/serenity/commit/ad0a001f0a Pull-request: https://github.com/SerenityOS/serenity/pull/14283 Reviewed-by: https://github.com/linusg Reviewed-by: https://github.com/timschumi
2 changed files with 11 additions and 11 deletions
|
@ -25,14 +25,20 @@ export SERENITY_SOURCE_DIR="$(realpath "${SCRIPT}/../")"
|
|||
if [ "$SERENITY_TOOLCHAIN" = "Clang" ]; then
|
||||
export SERENITY_BUILD_DIR="${SERENITY_SOURCE_DIR}/Build/${SERENITY_ARCH}clang"
|
||||
export SERENITY_TOOLCHAIN_BINDIR="${SERENITY_SOURCE_DIR}/Toolchain/Local/clang/bin"
|
||||
export CC="clang --target=${SERENITY_ARCH}-pc-serenity --sysroot=${SERENITY_BUILD_DIR}/Root"
|
||||
export CXX="clang++ --target=${SERENITY_ARCH}-pc-serenity --sysroot=${SERENITY_BUILD_DIR}/Root"
|
||||
export CC="${SERENITY_ARCH}-pc-serenity-clang"
|
||||
export CXX="${SERENITY_ARCH}-pc-serenity-clang++"
|
||||
export AR="llvm-ar"
|
||||
export RANLIB="llvm-ranlib"
|
||||
export READELF="llvm-readelf"
|
||||
export OBJCOPY="llvm-objcopy"
|
||||
export STRIP="llvm-strip"
|
||||
export CXXFILT="llvm-cxxfilt"
|
||||
# FIXME: Remove after next toolchain update (symlinks already in BuildClang.sh)
|
||||
if [ ! -f "${SERENITY_TOOLCHAIN_BINDIR}/${SERENITY_ARCH}-pc-serenity-clang" ]; then
|
||||
ln -s clang "${SERENITY_TOOLCHAIN_BINDIR}/${SERENITY_ARCH}-pc-serenity-clang"
|
||||
ln -s clang++ "${SERENITY_TOOLCHAIN_BINDIR}/${SERENITY_ARCH}-pc-serenity-clang++"
|
||||
echo "--sysroot=${SERENITY_BUILD_DIR}/Root" > "${SERENITY_TOOLCHAIN_BINDIR}/${SERENITY_ARCH}-pc-serenity.cfg"
|
||||
fi
|
||||
else
|
||||
export SERENITY_BUILD_DIR="${SERENITY_SOURCE_DIR}/Build/${SERENITY_ARCH}"
|
||||
export SERENITY_TOOLCHAIN_BINDIR="${SERENITY_SOURCE_DIR}/Toolchain/Local/${SERENITY_ARCH}/bin"
|
||||
|
|
|
@ -28,15 +28,9 @@ enable_ccache() {
|
|||
if [ "${USE_CCACHE:-true}" = "true" ] && command -v ccache &>/dev/null; then
|
||||
ccache_tooldir="${SERENITY_BUILD_DIR}/ccache"
|
||||
mkdir -p "$ccache_tooldir"
|
||||
if [ "$SERENITY_TOOLCHAIN" = "Clang" ]; then
|
||||
for tool in clang clang++; do
|
||||
ln -sf "$(command -v ccache)" "${ccache_tooldir}/$tool"
|
||||
done
|
||||
else
|
||||
for tool in gcc g++ c++; do
|
||||
ln -sf "$(command -v ccache)" "${ccache_tooldir}/${SERENITY_ARCH}-pc-serenity-${tool}"
|
||||
done
|
||||
fi
|
||||
for tool in cc clang gcc c++ clang++ g++; do
|
||||
ln -sf "$(command -v ccache)" "${ccache_tooldir}/${SERENITY_ARCH}-pc-serenity-${tool}"
|
||||
done
|
||||
export PATH="${ccache_tooldir}:$PATH"
|
||||
fi
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue