@@ -3,19 +3,29 @@ load("@rules_cc//cc:defs.bzl", "cc_library")
33
44CODSPEED_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
716cc_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
0 commit comments