Skip to content

Commit c5d1fcf

Browse files
committed
feat: update bazel build
1 parent 98acc5a commit c5d1fcf

2 files changed

Lines changed: 32 additions & 1 deletion

File tree

BUILD.bazel

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,19 @@ cc_library(
22
name = "yaml-cpp_internal",
33
visibility = ["//:__subpackages__"],
44
strip_include_prefix = "src",
5+
copts = [
6+
"-std=c++11",
7+
],
58
hdrs = glob(["src/**/*.h"]),
69
)
710

811
cc_library(
912
name = "yaml-cpp",
1013
visibility = ["//visibility:public"],
1114
includes = ["include"],
15+
copts = [
16+
"-std=c++11",
17+
],
1218
hdrs = glob(["include/**/*.h"]),
1319
srcs = glob(["src/**/*.cpp", "src/**/*.h"]),
1420
)

README.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ If you find a bug, post an [issue](https://github.com/jbeder/yaml-cpp/issues)! I
1010

1111
# How to Build #
1212

13+
## CMake
14+
1315
yaml-cpp uses [CMake](http://www.cmake.org) to support cross-platform building. The basic steps to build are:
1416

1517
1. Download and install [CMake](http://www.cmake.org) (Resources -> Download).
@@ -42,6 +44,29 @@ cmake [-G generator] [-DYAML_BUILD_SHARED_LIBS=ON|OFF] ..
4244

4345
5. To clean up, just remove the `build` directory.
4446

47+
## Bazel
48+
49+
## Build
50+
51+
```bash
52+
$ bazel build :yaml-cpp
53+
```
54+
55+
## Dependency
56+
57+
```python
58+
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
59+
# ----------------------------------------------------------------------
60+
# Yaml parser
61+
# ----------------------------------------------------------------------
62+
git_repository(
63+
name = "yaml_parser",
64+
remote = "https://github.com/jbeder/yaml-cpp.git",
65+
#commit = "98acc5a",
66+
#tag = "",
67+
)
68+
```
69+
4570
# Recent Release #
4671

4772
[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] ..
5075

5176
**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.
5277

53-
# API Documentation
78+
# API Documentation
5479

5580
The autogenerated API reference is hosted on [CodeDocs](https://codedocs.xyz/jbeder/yaml-cpp/index.html)
5681

0 commit comments

Comments
 (0)