add tf-c-header rule
MODIFY
tensorflow_io/core/plugins/BUILD
tensorflow_io/core/plugins/BUILD
@@ -16,7 +16,7 @@ cc_library(
linkstatic = True,
deps = [
"@local_config_tf//:libtensorflow_framework",
- "@local_config_tf//:tf_header_lib",
+ "@local_config_tf//:tf_c_header_lib",
],
alwayslink = 1,
)

MODIFY
tensorflow_io/core/plugins/hdfs/BUILD
tensorflow_io/core/plugins/hdfs/BUILD
@@ -16,6 +16,8 @@ cc_library(
linkstatic = True,
deps = [
"//tensorflow_io/core/plugins:plugins_header",
+ "@com_google_absl//absl/strings",
+ "@com_google_absl//absl/synchronization",
"@hadoop",
],
alwayslink = 1,

MODIFY
third_party/toolchains/tf/BUILD.tpl
third_party/toolchains/tf/BUILD.tpl
@@ -7,6 +7,14 @@ cc_library(
visibility = ["//visibility:public"],
)
+cc_library(
+ name = "tf_c_header_lib",
+ hdrs = [":tf_c_header_include"],
+ include_prefix = "tensorflow/c",
+ strip_include_prefix = "include_c",
+ visibility = ["//visibility:public"],
+)
+
cc_library(
name = "libtensorflow_framework",
srcs = [":libtensorflow_framework.so"],
@@ -15,4 +23,5 @@ cc_library(
)
%{TF_HEADER_GENRULE}
+%{TF_C_HEADER_GENRULE}
%{TF_SHARED_LIBRARY_GENRULE}

MODIFY
third_party/toolchains/tf/tf_configure.bzl
third_party/toolchains/tf/tf_configure.bzl
@@ -176,6 +176,12 @@ def _tf_pip_impl(repository_ctx):
"tf_header_include",
tf_pip_dir_rename_pair = ["tensorflow_core", "tensorflow"],
)
+ tf_c_header_rule = _symlink_genrule_for_dir(
+ repository_ctx,
+ tf_header_dir + "/tensorflow/c/",
+ "include_c",
+ "tf_c_header_include",
+ )
tf_shared_library_dir = repository_ctx.os.environ[_TF_SHARED_LIBRARY_DIR]
tf_shared_library_name = repository_ctx.os.environ[_TF_SHARED_LIBRARY_NAME]
@@ -192,6 +198,7 @@ def _tf_pip_impl(repository_ctx):
_tpl(repository_ctx, "BUILD", {
"%{TF_HEADER_GENRULE}": tf_header_rule,
+ "%{TF_C_HEADER_GENRULE}": tf_c_header_rule,
"%{TF_SHARED_LIBRARY_GENRULE}": tf_shared_library_rule,
})

add tf-c-header rule (#1244)