diff options
author | Jason Zaman <jason@perfinion.com> | 2018-06-26 19:44:49 +0800 |
---|---|---|
committer | Jason Zaman <jason@perfinion.com> | 2018-07-13 11:25:51 +0800 |
commit | 209e4d12a2f0237768d1306a5be411479a8d4b12 (patch) | |
tree | 915f8ef1f47d612b419d19d3865d55df351e5bfa | |
parent | 9cfb09e670557cb9f92a72295c0f1974f6e00108 (diff) |
third_party: unbundle jsoncpp dep
The jsoncpp headers are included with a different path so we have to
symlink them so the are in the dir structure that is expected.
Signed-off-by: Jason Zaman <jason@perfinion.com>
-rw-r--r-- | tensorflow/workspace.bzl | 1 | ||||
-rw-r--r-- | third_party/systemlibs/jsoncpp.BUILD | 37 | ||||
-rw-r--r-- | third_party/systemlibs/syslibs_configure.bzl | 1 |
3 files changed, 39 insertions, 0 deletions
diff --git a/tensorflow/workspace.bzl b/tensorflow/workspace.bzl index 2c20316a9c..af21230ab5 100644 --- a/tensorflow/workspace.bzl +++ b/tensorflow/workspace.bzl @@ -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( diff --git a/third_party/systemlibs/jsoncpp.BUILD b/third_party/systemlibs/jsoncpp.BUILD new file mode 100644 index 0000000000..cf91917cfb --- /dev/null +++ b/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"], +) diff --git a/third_party/systemlibs/syslibs_configure.bzl b/third_party/systemlibs/syslibs_configure.bzl index d2da333e60..2188ffce66 100644 --- a/third_party/systemlibs/syslibs_configure.bzl +++ b/third_party/systemlibs/syslibs_configure.bzl @@ -19,6 +19,7 @@ VALID_LIBS=[ "grpc", "jemalloc", "jpeg", + "jsoncpp_git", "lmdb", "nasm", "org_sqlite", |