Skip to content

Commit 48e91c3

Browse files
committed
fix: ignore warnings for instrument-hooks
1 parent 89ced11 commit 48e91c3

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

core/BUILD

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,29 @@ load("@rules_cc//cc:defs.bzl", "cc_library")
33

44
CODSPEED_VERSION = "1.1.1"
55

6+
# Define the instrument-hooks library separately to apply warning suppressions
7+
cc_library(
8+
name = "instrument_hooks",
9+
srcs = ["instrument-hooks/dist/core.c"],
10+
hdrs = glob(["instrument-hooks/includes/*.h"]),
11+
includes = ["instrument-hooks/includes"],
12+
copts = ["-Wno-unused-variable", "-Wno-unused-parameter", "-Wno-unused-but-set-variable"],
13+
)
14+
615
# Define the codspeed library
716
cc_library(
817
name = "codspeed",
9-
srcs = glob(["src/**/*.cpp"]) + ["instrument-hooks/dist/core.c"],
10-
hdrs = glob(["include/**/*.h"] + ["include/**/*.hpp"] + ["instrument-hooks/includes/*.h"]),
11-
includes = ["include", "instrument-hooks/includes"],
18+
srcs = glob(["src/**/*.cpp"]),
19+
hdrs = glob(["include/**/*.h"] + ["include/**/*.hpp"]),
20+
includes = ["include"],
1221
defines = [
1322
"CODSPEED_VERSION=\\\"{}\\\"".format(CODSPEED_VERSION),
1423
] + select({
1524
":instrumentation_mode": ["CODSPEED_ENABLED", "CODSPEED_INSTRUMENTATION"],
1625
":walltime_mode": ["CODSPEED_ENABLED", "CODSPEED_WALLTIME"],
1726
"//conditions:default": [],
1827
}),
28+
deps = [":instrument_hooks"],
1929
visibility = ["//visibility:public"],
2030
)
2131

core/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ add_library(
2222
instrument-hooks/dist/core.c
2323
)
2424

25+
# Suppress warnings only for instrument-hooks/dist/core.c
26+
set_source_files_properties(
27+
instrument-hooks/dist/core.c
28+
PROPERTIES COMPILE_FLAGS "-Wno-unused-variable -Wno-unused-parameter"
29+
)
30+
2531
# Version
2632
add_compile_definitions(CODSPEED_VERSION="${CODSPEED_VERSION}")
2733

0 commit comments

Comments
 (0)