Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion packages/react-native/scripts/xcode/ccache-clang++.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,18 @@ REACT_NATIVE_CCACHE_CONFIGPATH=$SCRIPT_DIR/ccache.conf
# Provide our config file if none is already provided
export CCACHE_CONFIGPATH="${CCACHE_CONFIGPATH:-$REACT_NATIVE_CCACHE_CONFIGPATH}"

exec $CCACHE_BINARY clang++ "$@"
# CCACHE_BINARY does not reach compile tasks, and Xcode app builds may not have Homebrew on PATH.
if [ -z "$CCACHE_BINARY" ]; then
for candidate in "$(command -v ccache)" /opt/homebrew/bin/ccache /usr/local/bin/ccache; do
if [ -x "$candidate" ]; then
CCACHE_BINARY="$candidate"
break
fi
done
fi

if [ -n "$CCACHE_BINARY" ]; then
exec "$CCACHE_BINARY" clang++ "$@"
fi

exec clang++ "$@"
16 changes: 15 additions & 1 deletion packages/react-native/scripts/xcode/ccache-clang.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,18 @@ REACT_NATIVE_CCACHE_CONFIGPATH=$SCRIPT_DIR/ccache.conf
# Provide our config file if none is already provided
export CCACHE_CONFIGPATH="${CCACHE_CONFIGPATH:-$REACT_NATIVE_CCACHE_CONFIGPATH}"

exec $CCACHE_BINARY clang "$@"
# CCACHE_BINARY does not reach compile tasks, and Xcode app builds may not have Homebrew on PATH.
if [ -z "$CCACHE_BINARY" ]; then
for candidate in "$(command -v ccache)" /opt/homebrew/bin/ccache /usr/local/bin/ccache; do
if [ -x "$candidate" ]; then
CCACHE_BINARY="$candidate"
break
fi
done
fi

if [ -n "$CCACHE_BINARY" ]; then
exec "$CCACHE_BINARY" clang "$@"
fi

exec clang "$@"