mirror of
https://github.com/zebrajr/tensorflow.git
synced 2025-12-06 12:20:11 +01:00
Do not write TF_CONFIGURE_IOS to .bazelrc, only use it in ./configure.py.
PiperOrigin-RevId: 363484115 Change-Id: I5fd6186f19d1612ef9fe85a088aa7a72dc45d26d
This commit is contained in:
parent
0d6848cf23
commit
dd372ec5e1
1
.bazelrc
1
.bazelrc
|
|
@ -542,7 +542,6 @@ try-import %workspace%/.bazelrc.user
|
||||||
# Here are bazelrc configs for release builds
|
# Here are bazelrc configs for release builds
|
||||||
build:release_base --config=v2
|
build:release_base --config=v2
|
||||||
build:release_base --distinct_host_configuration=false
|
build:release_base --distinct_host_configuration=false
|
||||||
build:release_base --action_env TF_CONFIGURE_IOS="0"
|
|
||||||
|
|
||||||
build:release_cpu_linux --config=release_base
|
build:release_cpu_linux --config=release_base
|
||||||
build:release_cpu_linux --config=avx_linux
|
build:release_cpu_linux --config=avx_linux
|
||||||
|
|
|
||||||
15
configure.py
15
configure.py
|
|
@ -1201,13 +1201,12 @@ def config_info_line(name, help_text):
|
||||||
print('\t--config=%-12s\t# %s' % (name, help_text))
|
print('\t--config=%-12s\t# %s' % (name, help_text))
|
||||||
|
|
||||||
|
|
||||||
def configure_ios():
|
def configure_ios(environ_cp):
|
||||||
"""Configures TensorFlow for iOS builds.
|
"""Configures TensorFlow for iOS builds."""
|
||||||
|
|
||||||
This function will only be executed if `is_macos()` is true.
|
|
||||||
"""
|
|
||||||
if not is_macos():
|
if not is_macos():
|
||||||
return
|
return
|
||||||
|
if not get_var(environ_cp, 'TF_CONFIGURE_IOS', 'iOS', False):
|
||||||
|
return
|
||||||
for filepath in APPLE_BAZEL_FILES:
|
for filepath in APPLE_BAZEL_FILES:
|
||||||
existing_filepath = os.path.join(_TF_WORKSPACE_ROOT, filepath + '.apple')
|
existing_filepath = os.path.join(_TF_WORKSPACE_ROOT, filepath + '.apple')
|
||||||
renamed_filepath = os.path.join(_TF_WORKSPACE_ROOT, filepath)
|
renamed_filepath = os.path.join(_TF_WORKSPACE_ROOT, filepath)
|
||||||
|
|
@ -1326,8 +1325,6 @@ def main():
|
||||||
|
|
||||||
if is_macos():
|
if is_macos():
|
||||||
environ_cp['TF_NEED_TENSORRT'] = '0'
|
environ_cp['TF_NEED_TENSORRT'] = '0'
|
||||||
else:
|
|
||||||
environ_cp['TF_CONFIGURE_IOS'] = '0'
|
|
||||||
|
|
||||||
with_xla_support = environ_cp.get('TF_ENABLE_XLA', None)
|
with_xla_support = environ_cp.get('TF_ENABLE_XLA', None)
|
||||||
if with_xla_support is not None:
|
if with_xla_support is not None:
|
||||||
|
|
@ -1451,9 +1448,7 @@ def main():
|
||||||
|
|
||||||
system_specific_test_config(environ_cp)
|
system_specific_test_config(environ_cp)
|
||||||
|
|
||||||
set_action_env_var(environ_cp, 'TF_CONFIGURE_IOS', 'iOS', False)
|
configure_ios(environ_cp)
|
||||||
if environ_cp.get('TF_CONFIGURE_IOS') == '1':
|
|
||||||
configure_ios()
|
|
||||||
|
|
||||||
print('Preconfigured Bazel build configs. You can use any of the below by '
|
print('Preconfigured Bazel build configs. You can use any of the below by '
|
||||||
'adding "--config=<>" to your build command. See .bazelrc for more '
|
'adding "--config=<>" to your build command. See .bazelrc for more '
|
||||||
|
|
|
||||||
|
|
@ -161,15 +161,10 @@ if ! grep -q "3.4.0" ".bazelversion"; then
|
||||||
echo "3.4.0" > .bazelversion
|
echo "3.4.0" > .bazelversion
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check if users already run configure
|
# Check if users ran configure with iOS enabled.
|
||||||
if [ ! -f "$ROOT_DIR/.tf_configure.bazelrc" ]; then
|
if [ ! -f "$ROOT_DIR/TensorFlowLiteObjC.podspec" ]; then
|
||||||
echo "ERROR: Please run ./configure first."
|
echo "ERROR: Please run ./configure with iOS config."
|
||||||
exit 1
|
exit 1
|
||||||
else
|
|
||||||
if ! grep -q "TF_CONFIGURE_IOS=\"1\"" "$ROOT_DIR/.tf_configure.bazelrc"; then
|
|
||||||
echo "ERROR: Please run ./configure with iOS config."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Prepare the tmp directory.
|
# Prepare the tmp directory.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user