Remove core:lib dependency in favor of Lite-specific logging helper
authorAustin Anderson <angerson@google.com>
Tue, 6 Mar 2018 00:12:01 +0000 (16:12 -0800)
committerTensorFlower Gardener <gardener@tensorflow.org>
Tue, 6 Mar 2018 00:17:51 +0000 (16:17 -0800)
This CL makes an enormous swathe of TF Lite's tests buildable on Android
targets (and helps for many iOS tests, as well).

The only reason the tests dependended on tensorflow/core:lib was because lib was
the most common target that includes logging.h, which is necessary for
log-related tests.

This set of utilities may not be perfect (e.g. it still means that certain
TF-related test resources, like FLAGs, are not accessible), but it is an
improvement.

PiperOrigin-RevId: 187940806

tensorflow/contrib/lite/kernels/BUILD
tensorflow/core/BUILD

index 956bd35..7dc725d 100644 (file)
@@ -33,7 +33,7 @@ cc_library(
         "//tensorflow/contrib/lite:schema_fbs_version",
         "//tensorflow/contrib/lite:string_util",
         "//tensorflow/contrib/lite/testing:util",
-        "//tensorflow/core:lib",
+        "//tensorflow/core:tflite_portable_logging",
         "@com_google_googletest//:gtest",
     ],
 )
index 445cf5b..b7f84a4 100644 (file)
@@ -1665,6 +1665,25 @@ cc_library(
 )
 
 cc_library(
+    name = "tflite_portable_logging",
+    srcs = [],
+    hdrs = [
+        "lib/bfloat16/bfloat16.h",
+        "platform/default/integral_types.h",
+        "platform/default/logging.h",
+        "platform/logging.h",
+        "platform/macros.h",
+        "platform/platform.h",
+        "platform/types.h",
+    ],
+    copts = tf_copts(),
+    linkopts = ["-ldl"],
+    deps = [
+        "//tensorflow/core/platform/default/build_config:logging",
+    ],
+)
+
+cc_library(
     name = "android_jpeg_internal",
     srcs = if_android([
         "lib/jpeg/jpeg_handle.cc",