From c5d1fcf578babb4f19fa59f760e132e14a30be86 Mon Sep 17 00:00:00 2001 From: yicm Date: Thu, 24 Sep 2020 12:17:19 +0800 Subject: [PATCH 1/2] feat: update bazel build --- BUILD.bazel | 6 ++++++ README.md | 27 ++++++++++++++++++++++++++- 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/BUILD.bazel b/BUILD.bazel index b0b901606..4640b0d19 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -2,6 +2,9 @@ cc_library( name = "yaml-cpp_internal", visibility = ["//:__subpackages__"], strip_include_prefix = "src", + copts = [ + "-std=c++11", + ], hdrs = glob(["src/**/*.h"]), ) @@ -9,6 +12,9 @@ cc_library( name = "yaml-cpp", visibility = ["//visibility:public"], includes = ["include"], + copts = [ + "-std=c++11", + ], hdrs = glob(["include/**/*.h"]), srcs = glob(["src/**/*.cpp", "src/**/*.h"]), ) diff --git a/README.md b/README.md index ff4d3f3ca..0c5269881 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,8 @@ If you find a bug, post an [issue](https://github.com/jbeder/yaml-cpp/issues)! I # How to Build # +## CMake + yaml-cpp uses [CMake](http://www.cmake.org) to support cross-platform building. The basic steps to build are: 1. Download and install [CMake](http://www.cmake.org) (Resources -> Download). @@ -42,6 +44,29 @@ cmake [-G generator] [-DYAML_BUILD_SHARED_LIBS=ON|OFF] .. 5. To clean up, just remove the `build` directory. +## Bazel + +## Build + +```bash +$ bazel build :yaml-cpp +``` + +## Dependency + +```python +load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") +# ---------------------------------------------------------------------- +# Yaml parser +# ---------------------------------------------------------------------- +git_repository( + name = "yaml_parser", + remote = "https://github.com/jbeder/yaml-cpp.git", + #commit = "98acc5a", + #tag = "", +) +``` + # Recent Release # [yaml-cpp 0.6.0](https://github.com/jbeder/yaml-cpp/releases/tag/yaml-cpp-0.6.0) has been released! This release requires C++11, and no longer depends on Boost. @@ -50,7 +75,7 @@ cmake [-G generator] [-DYAML_BUILD_SHARED_LIBS=ON|OFF] .. **The old API will continue to be supported, and will still receive bugfixes!** The 0.3.x and 0.4.x versions will be old API releases, and 0.5.x and above will all be new API releases. -# API Documentation +# API Documentation The autogenerated API reference is hosted on [CodeDocs](https://codedocs.xyz/jbeder/yaml-cpp/index.html) From e6434ff2948f725ef68304195e2aa80ab9dc041a Mon Sep 17 00:00:00 2001 From: yicm Date: Thu, 24 Sep 2020 12:25:15 +0800 Subject: [PATCH 2/2] docs: update --- README.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 0c5269881..e13de759f 100644 --- a/README.md +++ b/README.md @@ -46,13 +46,13 @@ cmake [-G generator] [-DYAML_BUILD_SHARED_LIBS=ON|OFF] .. ## Bazel -## Build +### Build ```bash $ bazel build :yaml-cpp ``` -## Dependency +### External Dependency ```python load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") @@ -61,9 +61,8 @@ load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") # ---------------------------------------------------------------------- git_repository( name = "yaml_parser", - remote = "https://github.com/jbeder/yaml-cpp.git", - #commit = "98acc5a", - #tag = "", + remote = "https://github.com/yicm/yaml-cpp.git", + commit = "c5d1fcf", ) ```