@@ -3,19 +3,29 @@ load("@rules_cc//cc:defs.bzl", "cc_library")
3
3
4
4
CODSPEED_VERSION = "1.1.1"
5
5
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
+
6
15
# Define the codspeed library
7
16
cc_library (
8
17
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" ],
12
21
defines = [
13
22
"CODSPEED_VERSION=\\ \" {}\\ \" " .format (CODSPEED_VERSION ),
14
23
] + select ({
15
24
":instrumentation_mode" : ["CODSPEED_ENABLED" , "CODSPEED_INSTRUMENTATION" ],
16
25
":walltime_mode" : ["CODSPEED_ENABLED" , "CODSPEED_WALLTIME" ],
17
26
"//conditions:default" : [],
18
27
}),
28
+ deps = [":instrument_hooks" ],
19
29
visibility = ["//visibility:public" ],
20
30
)
21
31
0 commit comments