mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-08 04:11:17 +00:00
Add bazel Support (#724)
Example of how someone might consume yaml-cpp with bazel: cc_binary( name = "example", srcs = ["example.cc"], deps = ["@com_github_jbeder_yaml_cpp//:yaml-cpp"], )
This commit is contained in:

committed by
Jesse Beder

parent
5e9cb0128d
commit
62ff351432
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,2 +1,3 @@
|
|||||||
build/
|
build/
|
||||||
/tags
|
/tags
|
||||||
|
/bazel-*
|
||||||
|
14
BUILD.bazel
Normal file
14
BUILD.bazel
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
cc_library(
|
||||||
|
name = "yaml-cpp_internal",
|
||||||
|
visibility = ["//:__subpackages__"],
|
||||||
|
strip_include_prefix = "src",
|
||||||
|
hdrs = glob(["src/**/*.h"]),
|
||||||
|
)
|
||||||
|
|
||||||
|
cc_library(
|
||||||
|
name = "yaml-cpp",
|
||||||
|
visibility = ["//visibility:public"],
|
||||||
|
strip_include_prefix = "include",
|
||||||
|
hdrs = glob(["include/**/*.h"]),
|
||||||
|
srcs = glob(["src/**/*.cpp", "src/**/*.h"]),
|
||||||
|
)
|
10
WORKSPACE
Normal file
10
WORKSPACE
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
workspace(name = "com_github_jbeder_yaml_cpp")
|
||||||
|
|
||||||
|
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
|
||||||
|
|
||||||
|
http_archive(
|
||||||
|
name = "com_google_googletest",
|
||||||
|
strip_prefix = "googletest-release-1.8.1",
|
||||||
|
url = "https://github.com/google/googletest/archive/release-1.8.1.tar.gz",
|
||||||
|
sha256 = "9bf1fe5182a604b4135edc1a425ae356c9ad15e9b23f9f12a02e80184c3a249c",
|
||||||
|
)
|
14
test/BUILD.bazel
Normal file
14
test/BUILD.bazel
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
cc_test(
|
||||||
|
name = "test",
|
||||||
|
srcs = glob([
|
||||||
|
"*.cpp",
|
||||||
|
"*.h",
|
||||||
|
"integrations/*.cpp",
|
||||||
|
"node/*.cpp",
|
||||||
|
]),
|
||||||
|
deps = [
|
||||||
|
"//:yaml-cpp",
|
||||||
|
"//:yaml-cpp_internal",
|
||||||
|
"@com_google_googletest//:gtest_main",
|
||||||
|
],
|
||||||
|
)
|
Reference in New Issue
Block a user