diff --git a/BUILD.bazel b/BUILD.bazel index 45ae375ee..400fb8b1e 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -10,6 +10,9 @@ cc_library( name = "yaml-cpp_internal", visibility = ["//:__subpackages__"], strip_include_prefix = "src", + copts = [ + "-std=c++11", + ], hdrs = glob(["src/**/*.h"]), ) @@ -17,6 +20,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"]), defines = yaml_cpp_defines, diff --git a/README.md b/README.md index 285644ed7..e9a6206aa 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ See [Tutorial](https://github.com/jbeder/yaml-cpp/wiki/Tutorial) and [How to Emi If you find a bug, post an [issue](https://github.com/jbeder/yaml-cpp/issues)! If you have questions about how to use yaml-cpp, please post it on http://stackoverflow.com and tag it [`yaml-cpp`](http://stackoverflow.com/questions/tagged/yaml-cpp). ## How to Build +### CMake `yaml-cpp` uses [CMake](http://www.cmake.org) to support cross-platform building. Install [CMake](http://www.cmake.org) _(Resources -> Download)_ before proceeding. The basic steps to build are: @@ -66,6 +67,29 @@ FetchContent_MakeAvailable(yaml-cpp) target_link_libraries(YOUR_LIBRARY PUBLIC yaml-cpp::yaml-cpp) # The library or executable that require yaml-cpp library ``` +### Bazel + +#### Build + +```bash +$ bazel build :yaml-cpp +``` + +#### External Dependency + +```python +load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") +# ---------------------------------------------------------------------- +# Yaml parser +# ---------------------------------------------------------------------- +git_repository( + name = "yaml_parser", + remote = "https://github.com/yicm/yaml-cpp.git", + commit = "c5d1fcf", +) +``` + + ## Recent Releases [yaml-cpp 0.9.0](https://github.com/jbeder/yaml-cpp/releases/tag/yaml-cpp-0.9.0) released! @@ -74,7 +98,7 @@ target_link_libraries(YOUR_LIBRARY PUBLIC yaml-cpp::yaml-cpp) # The library or e **The old API will stop receiving bugfixes in 2026.** The 0.3.x versions provide the old API, and 0.5.x and above all provide the new API. -# API Documentation +# API Documentation The autogenerated API reference is hosted on [CodeDocs](https://codedocs.xyz/jbeder/yaml-cpp/index.html)