Skip to content

Commit f87f771

Browse files
authored
impl(docfx): introduce yaml-cpp dependency (#10964)
I will need to generate YAML files. These look simple until you start reading about how to quote string literals.
1 parent 81d2106 commit f87f771

5 files changed

Lines changed: 19 additions & 2 deletions

File tree

bazel/google_cloud_cpp_deps.bzl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,3 +229,14 @@ def google_cloud_cpp_deps(name = None):
229229
strip_prefix = "pugixml-1.13",
230230
build_file = Label("//bazel:pugixml.BUILD"),
231231
)
232+
233+
maybe(
234+
http_archive,
235+
name = "com_github_jbeder_yaml_cpp",
236+
urls = [
237+
"https://storage.googleapis.com/cloud-cpp-community-archive/com_github_jbeder_yaml_cpp/yaml-cpp-0.7.0.tar.gz",
238+
"https://github.com/jbeder/yaml-cpp/archive/yaml-cpp-0.7.0.tar.gz",
239+
],
240+
sha256 = "43e6a9fcb146ad871515f0d0873947e5d497a1c9c60c58cb102a97b47208b7c3",
241+
strip_prefix = "yaml-cpp-yaml-cpp-0.7.0",
242+
)

ci/cloudbuild/dockerfiles/fedora-37-cmake.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ RUN dnf makecache && dnf install -y "dnf-command(debuginfo-install)"
4040
RUN dnf makecache && dnf debuginfo-install -y libstdc++
4141

4242
# This is used by the docfx tool.
43-
RUN dnf makecache && dnf install -y pugixml-devel
43+
RUN dnf makecache && dnf install -y pugixml-devel yaml-cpp-devel
4444

4545
# Sets root's password to the empty string to enable users to get a root shell
4646
# inside the container with `su -` and no password. Sudo would not work because

docfx/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ cc_library(
3030
"//conditions:default": [],
3131
}),
3232
deps = [
33+
"@com_github_jbeder_yaml_cpp//:yaml-cpp",
3334
"@com_github_zeux_pugixml//:pugixml",
3435
],
3536
)

docfx/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ if (NOT GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS)
2424
endif ()
2525

2626
find_package(pugixml CONFIG REQUIRED)
27+
find_package(yaml-cpp CONFIG REQUIRED)
2728

2829
include(EnableWerror)
2930

@@ -34,7 +35,7 @@ add_library(
3435
google_cloud_cpp_add_common_options(docfx)
3536
target_include_directories(docfx PUBLIC "${PROJECT_SOURCE_DIR}")
3637
target_compile_features(docfx PUBLIC cxx_std_17)
37-
target_link_libraries(docfx PUBLIC pugixml::pugixml)
38+
target_link_libraries(docfx PUBLIC pugixml::pugixml yaml-cpp)
3839

3940
# To avoid maintaining the list of files for the library, export them to a .bzl
4041
# file.

vcpkg.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@
3131
{
3232
"name": "pugixml",
3333
"$description": "Only used for the docfx feature"
34+
},
35+
{
36+
"name": "yaml-cpp",
37+
"$description": "Only used for the docfx feature"
3438
}
3539
]
3640
}

0 commit comments

Comments
 (0)