diff --git a/scripts/build_ios.sh b/scripts/build_ios.sh index 872aa7667d8..046ea018de2 100755 --- a/scripts/build_ios.sh +++ b/scripts/build_ios.sh @@ -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++") diff --git a/scripts/build_local.sh b/scripts/build_local.sh index 8f95ffda131..b8436715012 100755 --- a/scripts/build_local.sh +++ b/scripts/build_local.sh @@ -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++")