提交 120b5362 编写于 作者: M Mehdi Amini 提交者: TensorFlower Gardener

Rename config tsl_link_protobuf to tsl_protobuf_header_only

This changes the default value to the original intent: exposing headers only
is a "hack" in the build graph and should be an "opt-in". Tensorflow does that
when building its shared library, but that shouldn't be the majority of the
clients (hopefully).
This also aligns with the default value for enabling the shared library mode
in tensorflow: it's off by default (even though TensorFlow changes the
default in its bazelrc!)

PiperOrigin-RevId: 481050893
上级 81f5f37e
......@@ -98,7 +98,7 @@
# nothing in a bazelrc will default to a monolithic build. The following line
# opts in to modular op registration support by default.
build --define framework_shared_object=true
build --define tsl_link_protobuf=false
build --define tsl_protobuf_header_only=true
build --define=use_fast_cpp_protos=true
build --define=allow_oversize_protos=true
......@@ -210,7 +210,7 @@ build:ios_fat --ios_multi_cpus=armv7,arm64,i386,x86_64
# By default, TensorFlow will build with a dependence on
# //tensorflow:libtensorflow_framework.so.
build:monolithic --define framework_shared_object=false
build:monolithic --define tsl_link_protobuf=true
build:monolithic --define tsl_protobuf_header_only=false
build:monolithic --experimental_link_static_libraries_once=false # b/229868128
# Please note that MKL on MacOS or windows is still not supported.
......
......@@ -48,8 +48,8 @@ config_setting(
# This should be removed after Tensorflow moves to cc_shared_library
config_setting(
name = "tsl_link_protobuf",
define_values = {"tsl_link_protobuf": "true"},
name = "tsl_protobuf_header_only",
define_values = {"tsl_protobuf_header_only": "true"},
visibility = ["//visibility:public"],
)
......
......@@ -807,7 +807,7 @@ def tf_protobuf_deps():
def tsl_protobuf_deps():
return if_tsl_link_protobuf([clean_dep("@com_google_protobuf//:protobuf")], [clean_dep("@com_google_protobuf//:protobuf_headers")])
# When tsl_link_protobuf is false, we need to add the protobuf library
# When tsl_protobuf_header_only is true, we need to add the protobuf library
# back into our binaries explicitly.
def tsl_cc_test(
name,
......
......@@ -57,8 +57,8 @@ def if_google(google_value, oss_value = []):
def if_tsl_link_protobuf(if_true, if_false = []):
return select({
clean_dep("//tensorflow/tsl:tsl_link_protobuf"): if_true,
"//conditions:default": if_false,
"//conditions:default": if_true,
clean_dep("//tensorflow/tsl:tsl_protobuf_header_only"): if_false,
})
def if_libtpu(if_true, if_false = []):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册