Skip to content

Commit

Permalink
third_party: unbundle jsoncpp dep
Browse files Browse the repository at this point in the history
The jsoncpp headers are included with a different path so we have to
symlnk them so the are in the dir structure that is expected.

Signed-off-by: Jason Zaman <jason@perfinion.com>
  • Loading branch information
perfinion committed Jul 4, 2018
1 parent 0c06787 commit 140c34b
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
1 change: 1 addition & 0 deletions tensorflow/workspace.bzl
Expand Up @@ -516,6 +516,7 @@ def tf_workspace(path_prefix="", tf_repo_name=""):
sha256 = "c49deac9e0933bcb7044f08516861a2d560988540b23de2ac1ad443b219afdb6",
strip_prefix = "jsoncpp-1.8.4",
build_file = clean_dep("//third_party:jsoncpp.BUILD"),
system_build_file = clean_dep("//third_party/systemlibs:jsoncpp.BUILD"),
)

tf_http_archive(
Expand Down
37 changes: 37 additions & 0 deletions third_party/systemlibs/jsoncpp.BUILD
@@ -0,0 +1,37 @@
licenses(["unencumbered"]) # Public Domain or MIT

filegroup(
name = "LICENSE",
visibility = ["//visibility:public"],
)

HEADERS = [
"include/json/autolink.h",
"include/json/config.h",
"include/json/features.h",
"include/json/forwards.h",
"include/json/json.h",
"include/json/reader.h",
"include/json/value.h",
"include/json/version.h",
"include/json/writer.h",
]

genrule(
name = "link_headers",
outs = HEADERS,
cmd = """
for i in $(OUTS); do
i=$${i##*/}
ln -vsf /usr/include/jsoncpp/json/$$i $(@D)/include/json/$$i
done
""",
)

cc_library(
name = "jsoncpp",
hdrs = HEADERS,
includes = ["."],
linkopts = ["-ljsoncpp"],
visibility = ["//visibility:public"],
)
1 change: 1 addition & 0 deletions third_party/systemlibs/syslibs_configure.bzl
Expand Up @@ -19,6 +19,7 @@ VALID_LIBS=[
"grpc",
"jemalloc",
"jpeg",
"jsoncpp_git",
"lmdb",
"nasm",
"org_sqlite",
Expand Down

0 comments on commit 140c34b

Please sign in to comment.