Skip to content

Commit

Permalink
Simplifying jpeg library header, and adding jpeg build target under t…
Browse files Browse the repository at this point in the history
…ensorflow/core/platform.

PiperOrigin-RevId: 272099272
  • Loading branch information
bmzhao authored and tensorflower-gardener committed Oct 1, 2019
1 parent 52143c2 commit 6f9c242
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions tensorflow/core/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2571,7 +2571,7 @@ cc_library(
deps = [
":lib",
":lib_internal",
"//tensorflow/core/platform/default/build_config:jpeg",
"//tensorflow/core/platform:jpeg",
],
)

Expand Down Expand Up @@ -2657,8 +2657,8 @@ cc_library(
linkopts = ["-ldl"],
deps = [
":core_stringpiece",
"//tensorflow/core/platform:jpeg",
"//tensorflow/core/platform:stringpiece",
"//tensorflow/core/platform/default/build_config:jpeg",
"//tensorflow/core/platform/default/build_config:logging",
"@com_google_absl//absl/base:core_headers",
"@com_google_absl//absl/strings",
Expand Down
8 changes: 8 additions & 0 deletions tensorflow/core/platform/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,14 @@ cc_library(
],
)

cc_library(
name = "jpeg",
hdrs = ["jpeg.h"],
deps = [
"@libjpeg_turbo//:jpeg",
],
)

cc_library(
name = "load_library",
textual_hdrs = ["load_library.h"],
Expand Down
2 changes: 1 addition & 1 deletion tensorflow/core/platform/default/build_config/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ cc_library(
name = "jpeg",
copts = tf_copts(),
deps = [
"@jpeg",
"@libjpeg_turbo//:jpeg",
],
)

Expand Down
14 changes: 3 additions & 11 deletions tensorflow/core/platform/jpeg.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,14 @@ limitations under the License.
#ifndef TENSORFLOW_CORE_PLATFORM_JPEG_H_
#define TENSORFLOW_CORE_PLATFORM_JPEG_H_

#include "tensorflow/core/platform/platform.h"

#if defined(PLATFORM_GOOGLE) && !defined(IS_MOBILE_PLATFORM)
#include "tensorflow/core/platform/google/build_config/jpeg.h"
#elif defined(PLATFORM_POSIX) || defined(PLATFORM_WINDOWS) || \
defined(PLATFORM_POSIX_ANDROID) || defined(IS_MOBILE_PLATFORM)
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>

extern "C" {
#include "jerror.h"
#include "jpeglib.h"
#include "jerror.h" // TF:libjpeg_turbo
#include "jpeglib.h" // TF:libjpeg_turbo
}
#else
#error Define the appropriate PLATFORM_<foo> macro for this platform
#endif

#endif // TENSORFLOW_CORE_PLATFORM_JPEG_H_
4 changes: 2 additions & 2 deletions tensorflow/tools/lib_package/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ genrule(
"@highwayhash//:LICENSE",
"@hwloc//:COPYING",
"@icu//:icu4c/LICENSE",
"@jpeg//:LICENSE.md",
"@libjpeg_turbo//:LICENSE.md",
"@lmdb//:LICENSE",
"@local_config_sycl//sycl:LICENSE.text",
"@local_config_tensorrt//:LICENSE",
Expand Down Expand Up @@ -225,7 +225,7 @@ genrule(
"@highwayhash//:LICENSE",
"@hwloc//:COPYING",
"@icu//:icu4j/main/shared/licenses/LICENSE",
"@jpeg//:LICENSE.md",
"@libjpeg_turbo//:LICENSE.md",
"@lmdb//:LICENSE",
"@local_config_sycl//sycl:LICENSE.text",
"@local_config_tensorrt//:LICENSE",
Expand Down
2 changes: 1 addition & 1 deletion tensorflow/tools/pip_package/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,9 @@ filegroup(
"@highwayhash//:LICENSE",
"@hwloc//:COPYING",
"@icu//:icu4c/LICENSE",
"@jpeg//:LICENSE.md",
"@keras_applications_archive//:LICENSE",
"@kissfft//:COPYING",
"@libjpeg_turbo//:LICENSE.md",
"@lmdb//:LICENSE",
"@local_config_mlir//:LICENSE.TXT",
"@local_config_sycl//sycl:LICENSE.text",
Expand Down
2 changes: 1 addition & 1 deletion third_party/jpeg/workspace.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ load("//third_party:repo.bzl", "third_party_http_archive")

def repo():
third_party_http_archive(
name = "jpeg",
name = "libjpeg_turbo",
urls = [
"https://storage.googleapis.com/mirror.tensorflow.org/github.com/libjpeg-turbo/libjpeg-turbo/archive/2.0.0.tar.gz",
"https://github.com/libjpeg-turbo/libjpeg-turbo/archive/2.0.0.tar.gz",
Expand Down
2 changes: 1 addition & 1 deletion third_party/nasm/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ cc_binary(
"output",
"x86",
],
visibility = ["@jpeg//:__pkg__"],
visibility = ["@libjpeg_turbo//:__pkg__"],
)

config_setting(
Expand Down
2 changes: 1 addition & 1 deletion third_party/nasm/BUILD.system
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ filegroup(
sh_binary(
name = "nasm",
srcs = ["nasm"],
visibility = ["@jpeg//:__pkg__"],
visibility = ["@libjpeg_turbo//:__pkg__"],
)

0 comments on commit 6f9c242

Please sign in to comment.