Skip to content

Commit 78aaf74

Browse files
andrewharptensorflower-gardener
authored andcommitted
Clean up android_srcs and remove unused ANDROID_TF_LITE_HDRS (explicitly disable layering checks for Android targets instead).
Change: 121618669
1 parent 4d055a8 commit 78aaf74

File tree

2 files changed

+16
-42
lines changed

2 files changed

+16
-42
lines changed

tensorflow/core/BUILD

Lines changed: 15 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,7 @@ filegroup(
593593
"//tensorflow/core/kernels:android_srcs",
594594
"//tensorflow/core/util/ctc:android_srcs",
595595
"common_runtime/gpu/gpu_tracer.cc",
596+
"common_runtime/gpu/gpu_tracer.h",
596597
] + glob(
597598
[
598599
"client/**/*.cc",
@@ -604,8 +605,6 @@ filegroup(
604605
"graph/**/*.cc",
605606
"lib/**/*.h",
606607
"lib/**/*.cc",
607-
"platform/*.h",
608-
"platform/*.cc",
609608
"platform/**/*.h",
610609
"platform/**/*.cc",
611610
"public/**/*.h",
@@ -617,52 +616,22 @@ filegroup(
617616
"**/*testutil*",
618617
"**/*testlib*",
619618
"**/*main.cc",
620-
"lib/jpeg/*.h",
621-
"lib/jpeg/*.cc",
622-
"lib/png/*.h",
623-
"lib/png/*.cc",
624-
"util/events_writer.cc",
625-
"util/events_writer.h",
626-
# Exclude all protobuf/google headers except protobuf_android.h
619+
"lib/jpeg/**/*",
620+
"lib/png/**/*",
621+
"util/events_writer.*",
622+
"platform/default/stream_executor.*",
627623
"platform/cuda.h",
628-
"platform/default/stream_executor.h",
629-
"platform/google/cord_coding.h",
630-
"platform/google/dynamic_annotations.h",
631-
"platform/google/integral_types.h",
632-
"platform/google/mutex.h",
633-
"platform/google/protobuf.h",
634-
"platform/google/stream_executor.h",
635-
"platform/google/tracing_impl.h",
636-
"platform/google/*.cc",
637-
"platform/google/test_benchmark.cc",
638-
"platform/google/test_benchmark.h",
639-
"platform/jpeg.h",
640-
"platform/stream_executor.h",
624+
"platform/google/**/*",
625+
"platform/jpeg.*",
626+
"platform/stream_executor.*",
641627
"user_ops/**/*.cu.cc",
642-
"common_runtime/gpu/*.cc",
643-
"common_runtime/gpu/pool_allocator.h",
644-
"common_runtime/gpu/gpu_bfc_allocator.h",
645-
"common_runtime/gpu/gpu_debug_allocator.h",
646-
"common_runtime/gpu/gpu_device.h",
647-
"common_runtime/gpu/gpu_util.h",
648-
"common_runtime/gpu/gpu_event_mgr.h",
649-
"common_runtime/gpu_device_factory.cc",
628+
"common_runtime/gpu/**/*",
629+
"common_runtime/gpu_device_factory.*",
650630
],
651631
),
652632
visibility = ["//visibility:public"],
653633
)
654634

655-
ANDROID_TF_LITE_HDRS = [
656-
"framework/tensor.h",
657-
"platform/default/integral_types.h",
658-
"platform/env.h",
659-
"platform/file_system.h",
660-
"platform/logging.h",
661-
"platform/platform.h",
662-
"platform/types.h",
663-
"public/session.h",
664-
] + proto_text_hdrs_and_srcs.hdrs
665-
666635
# Native library support for Android applications.
667636
# Does not contain operators, use :android_tensorflow_lib if you want full
668637
# operator support.
@@ -674,6 +643,9 @@ ANDROID_TF_LITE_HDRS = [
674643
# --crosstool_top=//external:android/crosstool \
675644
# --cpu=armeabi-v7a \
676645
# --host_crosstool_top=@bazel_tools//tools/cpp:toolchain
646+
#
647+
# Layering checks are explicitly disabled since hdrs are not used to
648+
# verify Android builds, which leads to incorrect and misleading header lists.
677649
cc_library(
678650
name = "android_tensorflow_lib_lite",
679651
srcs =
@@ -683,8 +655,8 @@ cc_library(
683655
],
684656
"//conditions:default": [],
685657
}),
686-
hdrs = ANDROID_TF_LITE_HDRS,
687658
copts = tf_copts() + ["-Os"],
659+
features = ["-layering_check"],
688660
tags = [
689661
"manual",
690662
"notap",
@@ -709,6 +681,7 @@ cc_library(
709681
"//conditions:default": [],
710682
}),
711683
copts = tf_copts(),
684+
features = ["-layering_check"],
712685
tags = [
713686
"manual",
714687
"notap",

tensorflow/core/kernels/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1746,6 +1746,7 @@ cc_library(
17461746
"//conditions:default": [],
17471747
}),
17481748
copts = tf_copts(),
1749+
features = ["-layering_check"],
17491750
tags = [
17501751
"manual",
17511752
"notap",

0 commit comments

Comments
 (0)