diff options
author | A. Unique TensorFlower <gardener@tensorflow.org> | 2018-04-26 12:10:34 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-04-26 12:13:16 -0700 |
commit | b6adaabea73669b112e88947546e41299f89d44c (patch) | |
tree | d4a567505cddcca10de8b85776067cee95c0e8d6 /tensorflow/core/platform/default | |
parent | d66adb41874acddfd9e01f46e064965ee39850ca (diff) |
Move */logging.cc into :platform_base since it already exposes the header loggging.h
This also brings env_time.h and env_time.cc, because on the 'default' platform logging needs env_time.
Add helpers tf_platform_srcs and tf_platform_hdrs to deal with files
that are not necessarily available in all platforms.
PiperOrigin-RevId: 194434322
Diffstat (limited to 'tensorflow/core/platform/default')
-rw-r--r-- | tensorflow/core/platform/default/build_config.bzl | 37 |
1 files changed, 17 insertions, 20 deletions
diff --git a/tensorflow/core/platform/default/build_config.bzl b/tensorflow/core/platform/default/build_config.bzl index ca0587e277..107c38114b 100644 --- a/tensorflow/core/platform/default/build_config.bzl +++ b/tensorflow/core/platform/default/build_config.bzl @@ -433,6 +433,23 @@ def tf_proto_library(name, srcs = [], has_services = None, use_grpc_plugin = has_services, ) +# A list of all files under platform matching the pattern in 'files'. In +# contrast with 'tf_platform_srcs' below, which seletive collects files that +# must be compiled in the 'default' platform, this is a list of all headers +# mentioned in the platform/* files. +def tf_platform_hdrs(files): + return native.glob(["platform/*/" + f for f in files]) + +def tf_platform_srcs(files): + base_set = ["platform/default/" + f for f in files] + windows_set = base_set + ["platform/windows/" + f for f in files] + posix_set = base_set + ["platform/posix/" + f for f in files] + return select({ + "//tensorflow:windows" : native.glob(windows_set), + "//tensorflow:windows_msvc" : native.glob(windows_set), + "//conditions:default" : native.glob(posix_set), + }) + def tf_additional_lib_hdrs(exclude = []): windows_hdrs = native.glob([ "platform/default/*.h", @@ -488,7 +505,6 @@ def tf_additional_proto_hdrs(): def tf_additional_proto_srcs(): return [ - "platform/default/logging.cc", "platform/default/protobuf.cc", ] @@ -511,25 +527,6 @@ def tf_protos_grappler(): extra_deps=tf_protos_grappler_impl(), otherwise=["//tensorflow/core/grappler/costs:op_performance_data_cc"]) -def tf_env_time_hdrs(): - return [ - "platform/env_time.h", - ] - -def tf_env_time_srcs(): - win_env_time = native.glob([ - "platform/windows/env_time.cc", - "platform/env_time.cc", - ], exclude = []) - return select({ - "//tensorflow:windows" : win_env_time, - "//tensorflow:windows_msvc" : win_env_time, - "//conditions:default" : native.glob([ - "platform/posix/env_time.cc", - "platform/env_time.cc", - ], exclude = []), - }) - def tf_additional_cupti_wrapper_deps(): return ["//tensorflow/core/platform/default/gpu:cupti_wrapper"] |