Skip to content

Commit

Permalink
feat: update bazel build
Browse files Browse the repository at this point in the history
  • Loading branch information
yicm committed Sep 24, 2020
1 parent 98acc5a commit c5d1fcf
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
6 changes: 6 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,19 @@ cc_library(
name = "yaml-cpp_internal",
visibility = ["//:__subpackages__"],
strip_include_prefix = "src",
copts = [
"-std=c++11",
],
hdrs = glob(["src/**/*.h"]),
)

cc_library(
name = "yaml-cpp",
visibility = ["//visibility:public"],
includes = ["include"],
copts = [
"-std=c++11",
],
hdrs = glob(["include/**/*.h"]),
srcs = glob(["src/**/*.cpp", "src/**/*.h"]),
)
27 changes: 26 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down Expand Up @@ -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.
Expand All @@ -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)

Expand Down

0 comments on commit c5d1fcf

Please sign in to comment.