Skip to content

Commit 167766a

Browse files
committed
feat(bazel): add workspace.bzlmod
1 parent 95a8918 commit 167766a

File tree

2 files changed

+38
-31
lines changed

2 files changed

+38
-31
lines changed

WORKSPACE.bzlmod

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,41 @@ load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
88
git_repository(
99
name = "instrument_hooks",
1010
remote = "https://github.com/CodSpeedHQ/instrument-hooks",
11-
commit = "42ed74076c697c2f06c5ac81a84ccee983d7f140",
11+
commit = "b1e401a4d031ad308edb22ed59a52253a1ebe924",
12+
build_file_content = """
13+
load("@rules_cc//cc:defs.bzl", "cc_library")
14+
15+
config_setting(
16+
name = "windows",
17+
constraint_values = ["@platforms//os:windows"],
18+
)
19+
20+
# Instrument-hooks library with warning suppressions
21+
cc_library(
22+
name = "instrument_hooks",
23+
srcs = ["dist/core.c"],
24+
hdrs = glob(["includes/*.h"]),
25+
includes = ["includes"],
26+
copts = select({
27+
":windows": [
28+
"/wd4101", # unreferenced local variable (equivalent to -Wno-unused-variable)
29+
"/wd4189", # local variable is initialized but not referenced (equivalent to -Wno-unused-but-set-variable)
30+
"/wd4100", # unreferenced formal parameter (equivalent to -Wno-unused-parameter)
31+
"/wd4245", # signed/unsigned mismatch
32+
"/wd4132", # const object should be initialized
33+
"/wd4146", # unary minus operator applied to unsigned type
34+
],
35+
"//conditions:default": [
36+
"-Wno-maybe-uninitialized",
37+
"-Wno-unused-variable",
38+
"-Wno-unused-parameter",
39+
"-Wno-unused-but-set-variable",
40+
"-Wno-type-limits",
41+
"-Wno-format",
42+
"-Wno-format-security",
43+
],
44+
}),
45+
visibility = ["//visibility:private"],
46+
)
47+
""",
1248
)

core/BUILD

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -8,35 +8,6 @@ config_setting(
88
constraint_values = ["@platforms//os:windows"],
99
)
1010

11-
# Instrument-hooks library with warning suppressions
12-
cc_library(
13-
name = "instrument_hooks",
14-
srcs = ["instrument-hooks/dist/core.c"],
15-
hdrs = glob(["instrument-hooks/includes/*.h"]),
16-
includes = ["instrument-hooks/includes"],
17-
copts = select({
18-
":windows": [
19-
"/wd4101", # unreferenced local variable (equivalent to -Wno-unused-variable)
20-
"/wd4189", # local variable is initialized but not referenced (equivalent to -Wno-unused-but-set-variable)
21-
"/wd4100", # unreferenced formal parameter (equivalent to -Wno-unused-parameter)
22-
"/wd4245", # signed/unsigned mismatch
23-
"/wd4132", # const object should be initialized
24-
"/wd4146", # unary minus operator applied to unsigned type
25-
],
26-
"//conditions:default": [
27-
"-Wno-maybe-uninitialized",
28-
"-Wno-unused-variable",
29-
"-Wno-unused-parameter",
30-
"-Wno-unused-but-set-variable",
31-
"-Wno-type-limits",
32-
"-Wno-format",
33-
"-Wno-format-security",
34-
],
35-
}),
36-
visibility = ["//visibility:public"],
37-
)
38-
39-
4011
# Define the codspeed library
4112
cc_library(
4213
name = "codspeed",
@@ -54,7 +25,7 @@ cc_library(
5425
":walltime_mode": ["CODSPEED_ENABLED", "CODSPEED_WALLTIME"],
5526
"//conditions:default": [],
5627
}),
57-
deps = [":instrument_hooks"],
28+
deps = ["@instrument_hooks//:instrument_hooks"],
5829
visibility = ["//visibility:public"],
5930
)
6031

0 commit comments

Comments
 (0)