Skip to content

Commit 4048fa3

Browse files
authored
add tf-c-header rule (#1244)
1 parent bea38ab commit 4048fa3

File tree

4 files changed

+20
-2
lines changed

4 files changed

+20
-2
lines changed

tensorflow_io/core/plugins/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ cc_library(
1616
linkstatic = True,
1717
deps = [
1818
"@local_config_tf//:libtensorflow_framework",
19-
"@local_config_tf//:tf_header_lib",
19+
"@local_config_tf//:tf_c_header_lib",
2020
],
2121
alwayslink = 1,
2222
)

tensorflow_io/core/plugins/hdfs/BUILD

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ cc_library(
1616
linkstatic = True,
1717
deps = [
1818
"//tensorflow_io/core/plugins:plugins_header",
19+
"@com_google_absl//absl/strings",
20+
"@com_google_absl//absl/synchronization",
1921
"@hadoop",
2022
],
2123
alwayslink = 1,

third_party/toolchains/tf/BUILD.tpl

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ cc_library(
77
visibility = ["//visibility:public"],
88
)
99

10+
cc_library(
11+
name = "tf_c_header_lib",
12+
hdrs = [":tf_c_header_include"],
13+
include_prefix = "tensorflow/c",
14+
strip_include_prefix = "include_c",
15+
visibility = ["//visibility:public"],
16+
)
17+
1018
cc_library(
1119
name = "libtensorflow_framework",
1220
srcs = [":libtensorflow_framework.so"],
@@ -15,4 +23,5 @@ cc_library(
1523
)
1624

1725
%{TF_HEADER_GENRULE}
18-
%{TF_SHARED_LIBRARY_GENRULE}
26+
%{TF_C_HEADER_GENRULE}
27+
%{TF_SHARED_LIBRARY_GENRULE}

third_party/toolchains/tf/tf_configure.bzl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,12 @@ def _tf_pip_impl(repository_ctx):
176176
"tf_header_include",
177177
tf_pip_dir_rename_pair = ["tensorflow_core", "tensorflow"],
178178
)
179+
tf_c_header_rule = _symlink_genrule_for_dir(
180+
repository_ctx,
181+
tf_header_dir + "/tensorflow/c/",
182+
"include_c",
183+
"tf_c_header_include",
184+
)
179185

180186
tf_shared_library_dir = repository_ctx.os.environ[_TF_SHARED_LIBRARY_DIR]
181187
tf_shared_library_name = repository_ctx.os.environ[_TF_SHARED_LIBRARY_NAME]
@@ -192,6 +198,7 @@ def _tf_pip_impl(repository_ctx):
192198

193199
_tpl(repository_ctx, "BUILD", {
194200
"%{TF_HEADER_GENRULE}": tf_header_rule,
201+
"%{TF_C_HEADER_GENRULE}": tf_c_header_rule,
195202
"%{TF_SHARED_LIBRARY_GENRULE}": tf_shared_library_rule,
196203
})
197204

0 commit comments

Comments
 (0)