Enable bitcode compilation (#11198)
In order to enable bitcode compilation it is necessary more than adding `-fembed-bitcode`. The `MACOSX_DEPLOYMENT_TARGET` variable must be defined and exported as well. In this commit the variable is defined grabbing the version of the underlying running macOS.
This commit is contained in:
parent
b126091bbb
commit
9358451d34
@ -18,7 +18,7 @@ set -e
|
|||||||
|
|
||||||
# Make sure we're on OS X.
|
# Make sure we're on OS X.
|
||||||
if [[ $(uname) != "Darwin" ]]; then
|
if [[ $(uname) != "Darwin" ]]; then
|
||||||
echo "ERROR: This makefile build requires OS X, which the current system "\
|
echo "ERROR: This makefile build requires macOS, which the current system "\
|
||||||
"is not."
|
"is not."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@ -37,7 +37,9 @@ rm -rf tensorflow/contrib/makefile/downloads
|
|||||||
#
|
#
|
||||||
# ld: -bind_at_load and -bitcode_bundle (Xcode setting ENABLE_BITCODE=YES) cannot be used together
|
# ld: -bind_at_load and -bitcode_bundle (Xcode setting ENABLE_BITCODE=YES) cannot be used together
|
||||||
#
|
#
|
||||||
export MACOSX_DEPLOYMENT_TARGET="10.10"
|
if [[ -n MACOSX_DEPLOYMENT_TARGET ]]; then
|
||||||
|
export MACOSX_DEPLOYMENT_TARGET=$(sw_vers -productVersion)
|
||||||
|
fi
|
||||||
|
|
||||||
# Pull down the required versions of the frameworks we need.
|
# Pull down the required versions of the frameworks we need.
|
||||||
tensorflow/contrib/makefile/download_dependencies.sh
|
tensorflow/contrib/makefile/download_dependencies.sh
|
||||||
@ -50,4 +52,3 @@ tensorflow/contrib/makefile/compile_ios_tensorflow.sh "-O3"
|
|||||||
|
|
||||||
# Creates a static universal library in
|
# Creates a static universal library in
|
||||||
# tensorflow/contrib/makefile/gen/lib/libtensorflow-core.a
|
# tensorflow/contrib/makefile/gen/lib/libtensorflow-core.a
|
||||||
|
|
||||||
|
@ -15,9 +15,12 @@
|
|||||||
# ==============================================================================
|
# ==============================================================================
|
||||||
# Builds protobuf 3 for iOS.
|
# Builds protobuf 3 for iOS.
|
||||||
|
|
||||||
set -x
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
if [[ -n MACOSX_DEPLOYMENT_TARGET ]]; then
|
||||||
|
export MACOSX_DEPLOYMENT_TARGET=$(sw_vers -productVersion)
|
||||||
|
fi
|
||||||
|
|
||||||
SCRIPT_DIR=$(dirname $0)
|
SCRIPT_DIR=$(dirname $0)
|
||||||
source "${SCRIPT_DIR}/build_helper.subr"
|
source "${SCRIPT_DIR}/build_helper.subr"
|
||||||
|
|
||||||
|
@ -31,6 +31,10 @@ function less_than_required_version() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if [[ -n MACOSX_DEPLOYMENT_TARGET ]]; then
|
||||||
|
export MACOSX_DEPLOYMENT_TARGET=$(sw_vers -productVersion)
|
||||||
|
fi
|
||||||
|
|
||||||
ACTUAL_XCODE_VERSION=$(xcodebuild -version | head -n 1 | sed 's/Xcode //')
|
ACTUAL_XCODE_VERSION=$(xcodebuild -version | head -n 1 | sed 's/Xcode //')
|
||||||
REQUIRED_XCODE_VERSION=7.3.0
|
REQUIRED_XCODE_VERSION=7.3.0
|
||||||
if less_than_required_version $ACTUAL_XCODE_VERSION 7 3 0
|
if less_than_required_version $ACTUAL_XCODE_VERSION 7 3 0
|
||||||
|
Loading…
Reference in New Issue
Block a user