mirror of
https://github.com/saymrwulf/pytorch.git
synced 2026-05-14 20:57:59 +00:00
Only set CCACHE_WRAPPER_PATH in the build scripts if it is not already passed in.
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/29002 Test Plan: Imported from OSS Differential Revision: D18277225 Pulled By: AshkanAliabadi fbshipit-source-id: eb70607790754cd5d214133967404242c05dd5d5
This commit is contained in:
parent
e8e7d93293
commit
1345dabb1d
2 changed files with 7 additions and 3 deletions
|
|
@ -26,7 +26,7 @@ if [ -n "${BUILD_PYTORCH_MOBILE:-}" ]; then
|
|||
if [ "${ENABLE_BITCODE:-}" == '1' ]; then
|
||||
CMAKE_ARGS+=("-DCMAKE_C_FLAGS=-fembed-bitcode")
|
||||
CMAKE_ARGS+=("-DCMAKE_CXX_FLAGS=-fembed-bitcode")
|
||||
fi
|
||||
fi
|
||||
else
|
||||
# Build protobuf from third_party so we have a host protoc binary.
|
||||
echo "Building protoc"
|
||||
|
|
@ -45,7 +45,9 @@ fi
|
|||
# CMAKE_CXX_COMPILER to /usr/bin/g++. In order to use ccache (if it is available) we
|
||||
# must override these variables via CMake arguments.
|
||||
CMAKE_ARGS+=("-DCMAKE_TOOLCHAIN_FILE=$CAFFE2_ROOT/cmake/iOS.cmake")
|
||||
CCACHE_WRAPPER_PATH=/usr/local/opt/ccache/libexec
|
||||
if [ -n "${CCACHE_WRAPPER_PATH:-}"]; then
|
||||
CCACHE_WRAPPER_PATH=/usr/local/opt/ccache/libexec
|
||||
fi
|
||||
if [ -d "$CCACHE_WRAPPER_PATH" ]; then
|
||||
CMAKE_ARGS+=("-DCMAKE_C_COMPILER=$CCACHE_WRAPPER_PATH/gcc")
|
||||
CMAKE_ARGS+=("-DCMAKE_CXX_COMPILER=$CCACHE_WRAPPER_PATH/g++")
|
||||
|
|
|
|||
|
|
@ -18,7 +18,9 @@ fi
|
|||
|
||||
# Use ccache if available (this path is where Homebrew installs ccache symlinks)
|
||||
if [ "$(uname)" == 'Darwin' ]; then
|
||||
CCACHE_WRAPPER_PATH=/usr/local/opt/ccache/libexec
|
||||
if [ -n "${CCACHE_WRAPPER_PATH:-}"]; then
|
||||
CCACHE_WRAPPER_PATH=/usr/local/opt/ccache/libexec
|
||||
fi
|
||||
if [ -d "$CCACHE_WRAPPER_PATH" ]; then
|
||||
CMAKE_ARGS+=("-DCMAKE_C_COMPILER=$CCACHE_WRAPPER_PATH/gcc")
|
||||
CMAKE_ARGS+=("-DCMAKE_CXX_COMPILER=$CCACHE_WRAPPER_PATH/g++")
|
||||
|
|
|
|||
Loading…
Reference in a new issue