提交 f4e89d45 编写于 作者: A Andrew Harp 提交者: TensorFlower Gardener

Add android_tensorflow_test_lib target and consistently use if_android in tensorflow/core/BUILD.

Change: 124005557
上级 41d6b889
...@@ -53,6 +53,7 @@ licenses(["notice"]) # Apache 2.0 ...@@ -53,6 +53,7 @@ licenses(["notice"]) # Apache 2.0
load( load(
"//tensorflow:tensorflow.bzl", "//tensorflow:tensorflow.bzl",
"if_android",
"tf_copts", "tf_copts",
"tf_cc_test", "tf_cc_test",
"tf_cc_tests", "tf_cc_tests",
...@@ -667,13 +668,7 @@ filegroup( ...@@ -667,13 +668,7 @@ filegroup(
# --host_crosstool_top=@bazel_tools//tools/cpp:toolchain # --host_crosstool_top=@bazel_tools//tools/cpp:toolchain
cc_library( cc_library(
name = "android_tensorflow_lib_lite", name = "android_tensorflow_lib_lite",
srcs = srcs = if_android(["//tensorflow/core:android_srcs"]),
select({
"//tensorflow:android": [
"//tensorflow/core:android_srcs",
],
"//conditions:default": [],
}),
copts = tf_copts() + ["-Os"], copts = tf_copts() + ["-Os"],
tags = [ tags = [
"manual", "manual",
...@@ -691,12 +686,7 @@ cc_library( ...@@ -691,12 +686,7 @@ cc_library(
# binary size (by packaging a reduced operator set) is a concern. # binary size (by packaging a reduced operator set) is a concern.
cc_library( cc_library(
name = "android_tensorflow_lib", name = "android_tensorflow_lib",
srcs = select({ srcs = if_android([":android_op_registrations_and_gradients"]),
"//tensorflow:android": [
":android_op_registrations_and_gradients",
],
"//conditions:default": [],
}),
copts = tf_copts(), copts = tf_copts(),
tags = [ tags = [
"manual", "manual",
...@@ -718,13 +708,7 @@ cc_library( ...@@ -718,13 +708,7 @@ cc_library(
# registration of ops to prune code size. # registration of ops to prune code size.
cc_library( cc_library(
name = "android_tensorflow_lib_selective_registration", name = "android_tensorflow_lib_selective_registration",
srcs = srcs = if_android(["//tensorflow/core:android_srcs"]),
select({
"//tensorflow:android": [
"//tensorflow/core:android_srcs",
],
"//conditions:default": [],
}),
copts = tf_copts() + [ copts = tf_copts() + [
"-Os", "-Os",
"-DSUPPORT_SELECTIVE_REGISTRATION", "-DSUPPORT_SELECTIVE_REGISTRATION",
...@@ -758,6 +742,41 @@ filegroup( ...@@ -758,6 +742,41 @@ filegroup(
visibility = ["//visibility:public"], visibility = ["//visibility:public"],
) )
filegroup(
name = "android_test_srcs",
# TODO(andrewharp/nhua):
# make more test-related sources portable e.g. "platform/test.cc",
srcs = [
"//tensorflow/core:framework/fake_input.cc",
"//tensorflow/core:framework/fake_input.h",
"//tensorflow/core:framework/tensor_testutil.cc",
"//tensorflow/core:framework/tensor_testutil.h",
"//tensorflow/core:platform/test.h",
"//tensorflow/core:util/reporter.cc",
"//tensorflow/core:util/reporter.h",
],
visibility = ["//visibility:public"],
)
# Portable library providing testing functionality for Tensorflow.
cc_library(
name = "android_tensorflow_test_lib",
testonly = 1,
srcs = if_android([":android_test_srcs"]),
copts = tf_copts() + ["-Os"],
tags = [
"manual",
"notap",
],
visibility = ["//visibility:public"],
deps = [
":android_tensorflow_lib",
":protos_cc",
"//tensorflow/core/platform/default/build_config:gtest",
"//third_party/eigen3",
],
)
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# Libraries with GPU facilities that are useful for writing kernels. # Libraries with GPU facilities that are useful for writing kernels.
cc_library( cc_library(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册