From 6fc6822f64268224062acbff8084126dfa9d9a09 Mon Sep 17 00:00:00 2001 From: Christopher Dunn Date: Wed, 5 May 2021 21:02:04 -0500 Subject: [PATCH] Bazil, copied from #1275 --- Building.md | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/Building.md b/Building.md index 30777ab..477b586 100644 --- a/Building.md +++ b/Building.md @@ -116,4 +116,31 @@ If you need, you can customize the jsoncpp recipe. Just clone/fork [it from gith See [integrations instructions](http://docs.conan.io/en/latest/integrations.html) for how to use your build system with conan. ### Building and testing with scons -No longer supported. But you might be able to recover it at commit at https://github.com/open-source-parsers/jsoncpp/commit/6d31cec7cf44dd7e14263f0ffbc888abf515d3dc . \ No newline at end of file +No longer supported. But you might be able to recover it at commit at https://github.com/open-source-parsers/jsoncpp/commit/6d31cec7cf44dd7e14263f0ffbc888abf515d3dc . + +### Building and testing with Bazel +To use specific JsonCpp version in your [Bazel](https://bazel.build/) project, edit your `WORKSPACE` file and add a [`http_archive`](https://docs.bazel.build/versions/master/repo/http.html#http_archive) rule: + + load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") + # ... + http_archive( + name = "jsoncpp", + # sha256 = "X.Y.Z.tar.gz SHA256", + strip_prefix = "jsoncpp-X.Y.Z", + urls = [ + "https://github.com/open-source-parsers/jsoncpp/archive/X.Y.Z.tar.gz", + ], + ) + +Replace `X.Y.Z` with a correct version, and optionally specify archive file's SHA256 hash. +To get the code directly from a git repository, add a [`git_repository`](https://docs.bazel.build/versions/master/repo/git.html#git_repository) instead: + + load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") + # ... + git_repository( + name = "jsoncpp", + branch = "master", + remote = "https://github.com/open-source-parsers/jsoncpp.git", + ) + +In either case, add `"@jsoncpp//:jsoncpp"` as a dependency to targets that use JsonCpp.