Skip to content

Commit f57fd18

Browse files
committed
Add JSON C++ library.
Signed-off-by: format 2020.01.21 <github.com/ChrisCummins/format>
1 parent cc633ce commit f57fd18

File tree

3 files changed

+42
-0
lines changed

3 files changed

+42
-0
lines changed

WORKSPACE

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,28 @@ http_archive(
334334
urls = ["https://github.com/stackb/rules_proto/archive/d9a123032f8436dbc34069cfc3207f2810a494ee.tar.gz"],
335335
)
336336

337+
# JSON C++ library.
338+
# https://github.com/nlohmann/json
339+
340+
http_archive(
341+
name = "nlohmann_json",
342+
build_file = "//:third_party/nlohmann_json.BUILD",
343+
sha256 = "87b5884741427220d3a33df1363ae0e8b898099fbc59f1c451113f6732891014",
344+
strip_prefix = "single_include",
345+
urls = ["https://github.com/nlohmann/json/releases/download/v3.7.3/include.zip"],
346+
)
347+
348+
# pybind11 bindings for JSON.
349+
# https://github.com/pybind/pybind11_json
350+
351+
http_archive(
352+
name = "pybind11_json",
353+
build_file = "//:third_party/pybind11_json.BUILD",
354+
sha256 = "45957f8564e921a412a6de49c578ef1faf3b04e531e859464853e26e1c734ea5",
355+
strip_prefix = "pybind11_json-0.2.4/include",
356+
urls = ["https://github.com/pybind/pybind11_json/archive/0.2.4.tar.gz"],
357+
)
358+
337359
# Python requirements.
338360

339361
# I use my own rules_python fork which adds a timeout arg to pip_import.

third_party/nlohmann_json.BUILD

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# JSON C++ library.
2+
# https://github.com/nlohmann/json
3+
4+
licenses(["notice"]) # MIT.
5+
6+
cc_library(
7+
name = "json",
8+
hdrs = ["nlohmann/json.hpp"],
9+
visibility = ["//visibility:public"],
10+
)

third_party/pybind11_json.BUILD

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# pybind11 bindings for JSON.
2+
# https://github.com/pybind/pybind11_json
3+
4+
licenses(["notice"]) # BSD.
5+
6+
cc_library(
7+
name = "pybind11_json",
8+
hdrs = ["pybind11_json/pybind11_json.hpp"],
9+
visibility = ["//visibility:public"],
10+
)

0 commit comments

Comments
 (0)