Skip to content

Commit 9ac8c36

Browse files
committed
fix: bazel build with customlabels
* BUILD.bazel * MODULE.bazel
1 parent 6ede5ed commit 9ac8c36

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

BUILD.bazel

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
config_setting(
2+
name = "is_linux",
3+
constraint_values = ["@platforms//os:linux"],
4+
)
5+
16
cc_library(
27
name = "dd_trace_cpp",
38
srcs = [
@@ -67,6 +72,7 @@ cc_library(
6772
"src/datadog/limiter.h",
6873
"src/datadog/msgpack.h",
6974
"src/datadog/null_logger.h",
75+
"src/datadog/otel_identifiers.h",
7076
"src/datadog/parse_util.h",
7177
"src/datadog/platform_util.h",
7278
"src/datadog/random.h",
@@ -134,5 +140,8 @@ cc_library(
134140
deps = [
135141
"@com_google_absl//absl/strings",
136142
"@com_google_absl//absl/types:optional",
137-
],
143+
] + select({
144+
":is_linux": ["@customlabels//:customlabels"],
145+
"//conditions:default": [],
146+
}),
138147
)

MODULE.bazel

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,24 @@ bazel_dep(
1111
name = "rules_cc",
1212
version = "0.0.9",
1313
)
14+
bazel_dep(
15+
name = "customlabels",
16+
version = "1.0.0",
17+
)
18+
bazel_dep(
19+
name = "platforms",
20+
version = "0.0.11",
21+
)
1422
# -- bazel_dep definitions -- #
1523

1624
non_module_dependencies = use_extension("//:extensions.bzl", "non_module_dependencies")
1725
use_repo(
1826
non_module_dependencies,
1927
"com_google_absl",
2028
)
29+
30+
git_override(
31+
module_name = "customlabels",
32+
remote = "https://github.com/DataDog/custom-labels.git",
33+
commit = "1bc74232c0e414f2c63139f7cf7ac0bdce57d258",
34+
)

0 commit comments

Comments
 (0)