Skip to content

Commit 57ee7cc

Browse files
authored
[build] Fix --enable-tensorflow flag propagation. (#30015)
Propagate `--enable-tensorflow` flag from build-script to build-script-impl. Resolves TF-1174: macOS test failures due to `no_tensorflow` lit feature.
1 parent 7041e27 commit 57ee7cc

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

utils/build-script

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -794,6 +794,11 @@ class BuildScriptInvocation(object):
794794
args.build_jobs)
795795
]
796796

797+
# SWIFT_ENABLE_TENSORFLOW
798+
if args.enable_tensorflow:
799+
impl_args += ["--enable-tensorflow"]
800+
# SWIFT_ENABLE_TENSORFLOW END
801+
797802
impl_args += args.build_script_impl_args
798803

799804
if args.dry_run:

utils/build-script-impl

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,10 @@ KNOWN_SETTINGS=(
243243
skip-merge-lipo-cross-compile-tools "" "set to skip running merge-lipo after installing cross-compiled host Swift tools"
244244
coverage-db "" "If set, coverage database to use when prioritizing testing"
245245
skip-local-host-install "" "If we are cross-compiling multiple targets, skip an install pass locally if the hosts match"
246+
247+
# SWIFT_ENABLE_TENSORFLOW
248+
enable-tensorflow "" "If true, enable compiling with TensorFlow support"
249+
# SWIFT_ENABLE_TENSORFLOW END
246250
)
247251

248252
components=(
@@ -1671,6 +1675,10 @@ for host in "${ALL_HOSTS[@]}"; do
16711675
-DSWIFT_TOOLS_ENABLE_LTO:STRING="${SWIFT_TOOLS_ENABLE_LTO}"
16721676
-DSWIFT_BUILD_RUNTIME_WITH_HOST_COMPILER:BOOL=$(true_false "${BUILD_RUNTIME_WITH_HOST_COMPILER}")
16731677
-DLIBDISPATCH_CMAKE_BUILD_TYPE:STRING="${LIBDISPATCH_BUILD_TYPE}"
1678+
1679+
# SWIFT_ENABLE_TENSORFLOW
1680+
-DSWIFT_ENABLE_TENSORFLOW:BOOL=$(true_false "${ENABLE_TENSORFLOW}")
1681+
# SWIFT_ENABLE_TENSORFLOW END
16741682
"${swift_cmake_options[@]}"
16751683
)
16761684

@@ -1719,13 +1727,6 @@ for host in "${ALL_HOSTS[@]}"; do
17191727
)
17201728
fi
17211729

1722-
if [[ "${ENABLE_TENSORFLOW}" ]] ; then
1723-
cmake_options=(
1724-
"${cmake_options[@]}"
1725-
-DSWIFT_ENABLE_TENSORFLOW:BOOL=TRUE
1726-
)
1727-
fi
1728-
17291730
if [[ ! "${SKIP_BUILD_LLDB}" ]] ; then
17301731
lldb_build_dir=$(build_directory ${host} lldb)
17311732
cmake_options=(

0 commit comments

Comments
 (0)