diff --git a/tensorflow/lite/delegates/flex/BUILD b/tensorflow/lite/delegates/flex/BUILD index d5ae8d056bde0d..814225a2ffabe4 100644 --- a/tensorflow/lite/delegates/flex/BUILD +++ b/tensorflow/lite/delegates/flex/BUILD @@ -1,5 +1,6 @@ load( "//tensorflow:tensorflow.bzl", + "if_android", "if_mobile", "if_not_mobile", "tf_cc_test", @@ -39,7 +40,7 @@ cc_library( hdrs = ["buffer_map.h"], compatible_with = get_compatible_with_portable(), copts = tf_opts_nortti_if_lite_protos(), - features = tf_features_nolayering_check_if_ios(), + features = tf_features_nolayering_check_if_ios() + if_android(["-layering_check"]), deps = [ ":buffer_map_util", ":util", @@ -60,7 +61,7 @@ cc_library( hdrs = ["buffer_map_util.h"], compatible_with = get_compatible_with_portable(), copts = tf_opts_nortti_if_lite_protos(), - features = tf_features_nolayering_check_if_ios(), + features = tf_features_nolayering_check_if_ios() + if_android(["-layering_check"]), deps = [ ":util", "//tensorflow/lite:string_util", @@ -158,7 +159,7 @@ cc_library( ], compatible_with = get_compatible_with_portable(), copts = tflite_copts() + tf_opts_nortti_if_mobile(), - features = tf_features_nolayering_check_if_ios(), + features = tf_features_nolayering_check_if_ios() + if_android(["-layering_check"]), visibility = ["//visibility:public"], deps = [ ":buffer_map", @@ -211,7 +212,7 @@ cc_library( hdrs = ["delegate_data.h"], compatible_with = get_compatible_with_portable(), copts = tf_opts_nortti_if_mobile(), - features = tf_features_nolayering_check_if_ios(), + features = tf_features_nolayering_check_if_ios() + if_android(["-layering_check"]), visibility = ["//visibility:public"], deps = [ ":buffer_map", @@ -264,6 +265,8 @@ cc_library( compatible_with = get_compatible_with_portable(), features = tf_features_nolayering_check_if_ios(), deps = [ + "//tensorflow/core/platform:mutex", + "//tensorflow/core/platform:thread_annotations", "//tensorflow/lite:cc_api_experimental", "//tensorflow/lite/core/c:common", ] + if_mobile([ @@ -315,7 +318,7 @@ cc_library( srcs = ["util.cc"], hdrs = ["util.h"], compatible_with = get_compatible_with_portable(), - features = tf_features_nolayering_check_if_ios(), + features = tf_features_nolayering_check_if_ios() + if_android(["-layering_check"]), #TODO(b/206038955): Consider restrict the visibility to '//third_party/fcp/client:__subpackages__'. visibility = ["//visibility:public"], deps = [ @@ -399,7 +402,7 @@ cc_library( srcs = ["tflite_subgraph_execute.cc"], compatible_with = get_compatible_with_portable(), copts = tf_opts_nortti_if_mobile(), - features = tf_features_nolayering_check_if_ios(), + features = tf_features_nolayering_check_if_ios() + if_android(["-layering_check"]), deps = [ ":buffer_map_util", ":subgraph_resource", diff --git a/tensorflow/lite/delegates/flex/build_def.bzl b/tensorflow/lite/delegates/flex/build_def.bzl index 069fd0edca025f..832f13d9571aad 100644 --- a/tensorflow/lite/delegates/flex/build_def.bzl +++ b/tensorflow/lite/delegates/flex/build_def.bzl @@ -137,7 +137,7 @@ def tflite_flex_cc_library( full = [], lite = ["TENSORFLOW_LITE_PROTOS"], ) + tf_defines_nortti_if_lite_protos(), - features = tf_features_nomodules_if_mobile() + tf_features_nolayering_check_if_ios(), + features = tf_features_nomodules_if_mobile() + tf_features_nolayering_check_if_ios() + if_android(["-layering_check"]), linkopts = if_android(["-lz"]) + if_ios(["-lz"]), includes = [ CUSTOM_KERNEL_HEADER.include_path, @@ -168,7 +168,7 @@ def tflite_flex_cc_library( hdrs = [ clean_dep("//tensorflow/lite/delegates/flex:delegate.h"), ], - features = tf_features_nolayering_check_if_ios(), + features = tf_features_nolayering_check_if_ios() + if_android(["-layering_check"]), compatible_with = compatible_with, visibility = visibility, deps = [ diff --git a/tensorflow/lite/kernels/shim/BUILD b/tensorflow/lite/kernels/shim/BUILD index 9aa10f1463769e..4afcf3a2444d64 100644 --- a/tensorflow/lite/kernels/shim/BUILD +++ b/tensorflow/lite/kernels/shim/BUILD @@ -1,6 +1,6 @@ # This package is a shim layer over TF and TFLite op kernels. -load("//tensorflow:tensorflow.bzl", "if_mobile", "if_not_mobile", "tf_cc_test", "tf_copts") +load("//tensorflow:tensorflow.bzl", "if_android", "if_mobile", "if_not_mobile", "tf_cc_test", "tf_copts") load("//tensorflow:tensorflow.default.bzl", "get_compatible_with_portable") package( @@ -74,6 +74,7 @@ cc_library( srcs = ["tf_tensor_view.cc"], hdrs = ["tf_tensor_view.h"], copts = tf_copts(), + features = if_android(["-layering_check"]), deps = [ ":tensor_view", "@com_google_absl//absl/status", @@ -153,6 +154,7 @@ cc_library( srcs = ["tf_op_shim.cc"], hdrs = ["tf_op_shim.h"], copts = tf_copts(), + features = if_android(["-layering_check"]), visibility = ["//visibility:public"], deps = [ ":op_kernel",