Split out lib/jpeg into a separate library from the rest of

TensorFlow to avoid unnecessary transitive dependencies.
Change: 137281975
This commit is contained in:
A. Unique TensorFlower 2016-10-26 08:07:23 -08:00 committed by TensorFlower Gardener
parent c8929e2e6e
commit d6bf2e93cf
3 changed files with 40 additions and 2 deletions
tensorflow/core
BUILD
kernels
platform/default/build_config

View File

@ -178,7 +178,6 @@ cc_library(
"lib/io/table.h",
"lib/io/table_builder.h",
"lib/io/table_options.h",
"lib/jpeg/jpeg_mem.h",
"lib/math/math_util.h",
"lib/monitoring/collected_metrics.h",
"lib/monitoring/collection_registry.h",
@ -220,6 +219,13 @@ cc_library(
],
)
cc_library(
name = "jpeg",
hdrs = ["lib/jpeg/jpeg_mem.h"],
visibility = ["//visibility:public"],
deps = [":jpeg_internal"],
)
# Test support library needed for all tests
# This is currently public, but may be made internal in the
# future. Try to avoid depending on it.
@ -971,6 +977,7 @@ cc_library(
],
exclude = [
"**/*test*",
"lib/jpeg/**/*",
"platform/**/cuda.h",
"platform/**/stream_executor.h",
"platform/load_library.cc",
@ -987,6 +994,7 @@ cc_library(
],
exclude = [
"**/*test*",
"lib/jpeg/**/*",
"platform/**/cuda.h",
"platform/**/stream_executor.h",
],
@ -1020,7 +1028,6 @@ cc_library(
"lib/io/zlib_compression_options.h",
"lib/io/zlib_inputstream.h",
"lib/io/zlib_outputbuffer.h",
"lib/jpeg/jpeg_handle.h",
"lib/png/png_io.h",
"lib/random/random.h",
"lib/random/random_distributions.h",
@ -1049,6 +1056,26 @@ cc_library(
],
)
cc_library(
name = "jpeg_internal",
srcs = glob(
[
"lib/jpeg/*h",
"lib/jpeg/*.cc",
],
exclude = [
"**/*test*",
],
),
hdrs = ["lib/jpeg/jpeg_handle.h"],
copts = tf_copts(),
linkopts = ["-ldl"],
deps = [
":lib",
"//tensorflow/core/platform/default/build_config:jpeg",
],
)
proto_text_hdrs_and_srcs = tf_generate_proto_text_sources(
name = "proto_text_srcs_all",
srcs = tf_proto_text_protos_relative(),
@ -1506,6 +1533,8 @@ cc_test(
srcs = ["lib/jpeg/jpeg_mem_unittest.cc"],
data = glob(["lib/jpeg/testdata/*.jpg"]),
deps = [
":jpeg",
":jpeg_internal",
":lib",
":lib_internal",
":test",

View File

@ -1076,6 +1076,7 @@ tf_kernel_libraries(
":image_resizer_state",
"//tensorflow/core:framework",
"//tensorflow/core:image_ops_op_lib",
"//tensorflow/core:jpeg",
"//tensorflow/core:lib",
"//tensorflow/core:lib_internal",
"//tensorflow/core:protos_all_cc",

View File

@ -86,6 +86,14 @@ cc_library(
],
)
cc_library(
name = "jpeg",
copts = tf_copts(),
deps = [
"@jpeg_archive//:jpeg",
],
)
cc_library(
name = "protos_cc",
copts = tf_copts(),