Skip to content

Commit

Permalink
[build-toolchain] Add distcc like integration for using sccache.
Browse files Browse the repository at this point in the history
Disabled by default.
  • Loading branch information
gottesmm committed Sep 26, 2020
1 parent bb954f9 commit e022a95
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions utils/build-toolchain
Expand Up @@ -45,6 +45,7 @@ cd "$(dirname $0)/.." || exit

# Set defaults
DISTCC_FLAG=
SCCACHE_FLAG=
DRY_RUN=
BUNDLE_PREFIX=
PRESET_FILE_FLAGS=
Expand Down Expand Up @@ -82,6 +83,15 @@ while [ $# -ne 0 ]; do
;;
--distcc)
DISTCC_FLAG="--distcc"
;;
--sccache)
SCCACHE=$(which sccache)
if [[ -z "${SCCACHE}" ]]; then
echo "Error! Asked to use sccache, but could not find sccache in PATH?!"
usage
exit 1
fi
SCCACHE_FLAG="--cmake-c-launcher=${SCCACHE} --cmake-cxx-launcher=${SCCACHE}"
;;
--preset-file)
shift
Expand Down Expand Up @@ -140,8 +150,10 @@ SYMBOLS_PACKAGE="${RESULT_DIR}/${SYM_ARCHIVE}"
DRY_RUN="${DRY_RUN}"
DISTCC_FLAG="${DISTCC_FLAG}"
PRESET_FILE_FLAGS="${PRESET_FILE_FLAGS}"
SCCACHE_FLAG="${SCCACHE_FLAG}"

./utils/build-script ${DRY_RUN} ${DISTCC_FLAG} ${PRESET_FILE_FLAGS} \
${SCCACHE_FLAG} \
--preset="${PRESET_PREFIX}${SWIFT_PACKAGE}${PRESET_SUFFIX}" \
install_destdir="${SWIFT_INSTALL_DIR}" \
installable_package="${SWIFT_INSTALLABLE_PACKAGE}" \
Expand Down

0 comments on commit e022a95

Please sign in to comment.