Skip to content

Commit

Permalink
Use civetweb as bazel_dep
Browse files Browse the repository at this point in the history
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
  • Loading branch information
mmorel-35 committed May 7, 2024
1 parent 5da70dd commit d1bd4d4
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 69 deletions.
7 changes: 1 addition & 6 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,8 @@ module(
repo_name = "com_github_jupp0r_prometheus_cpp",
)

data_deps_ext = use_extension("//bazel:repositories.bzl", "data_deps_ext")
use_repo(
data_deps_ext,
"civetweb",
)

bazel_dep(name = "boringssl", version = "0.0.0-20240530-2db0eb3")
bazel_dep(name = "civetweb", version = "1.16")
bazel_dep(name = "curl", version = "8.7.1", repo_name = "com_github_curl")
bazel_dep(name = "platforms", version = "0.0.10")
bazel_dep(name = "rules_cc", version = "0.0.9")
Expand Down
83 changes: 34 additions & 49 deletions MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions bazel/civetweb.BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ DEPS = select({
})

cc_library(
name = "libcivetweb",
name = "civetweb",
srcs = [
"src/civetweb.c",
],
Expand Down Expand Up @@ -79,7 +79,7 @@ cc_library(
)

cc_library(
name = "civetweb",
name = "civetserver",
srcs = [
"src/CivetServer.cpp",
],
Expand All @@ -100,6 +100,6 @@ cc_library(
}),
visibility = ["//visibility:public"],
deps = [
":libcivetweb",
":civetweb",
],
)
11 changes: 1 addition & 10 deletions bazel/repositories.bzl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")

def _legacy_and_bzlmod_repositories():
def prometheus_cpp_repositories():
maybe(
http_archive,
name = "civetweb",
Expand All @@ -13,9 +13,6 @@ def _legacy_and_bzlmod_repositories():
build_file = "@com_github_jupp0r_prometheus_cpp//bazel:civetweb.BUILD",
)

def prometheus_cpp_repositories():
_legacy_and_bzlmod_repositories()

# These legacy style repos have bzlmod support, they are re-added here for legacy support
maybe(
http_archive,
Expand Down Expand Up @@ -75,9 +72,3 @@ def prometheus_cpp_repositories():
build_file = "@com_github_jupp0r_prometheus_cpp//bazel:zlib.BUILD",
)

def _data_deps_extension_impl(ctx):
_legacy_and_bzlmod_repositories()

data_deps_ext = module_extension(
implementation = _data_deps_extension_impl,
)
2 changes: 1 addition & 1 deletion pull/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ cc_library(
deps = [
"//core",
"//util",
"@civetweb",
"@civetweb//:civetserver",
"@zlib",
],
)
Expand Down

0 comments on commit d1bd4d4

Please sign in to comment.