-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathBUILD
More file actions
41 lines (36 loc) · 1.03 KB
/
BUILD
File metadata and controls
41 lines (36 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
load("@bazel_skylib//rules:common_settings.bzl", "string_flag")
load("@rules_cc//cc:defs.bzl", "cc_library")
CODSPEED_VERSION = "1.1.0"
# Define the codspeed library
cc_library(
name = "codspeed",
srcs = glob(["src/**/*.cpp"]),
hdrs = glob(["include/**/*.h"] + ["include/**/*.hpp"]),
includes = ["include"],
defines = [
"CODSPEED_VERSION=\\\"{}\\\"".format(CODSPEED_VERSION),
] + select({
":instrumentation_mode": ["CODSPEED_ENABLED", "CODSPEED_INSTRUMENTATION"],
":walltime_mode": ["CODSPEED_ENABLED", "CODSPEED_WALLTIME"],
"//conditions:default": [],
}),
visibility = ["//visibility:public"],
)
# Codspeed mode
string_flag(
name = "codspeed_mode",
build_setting_default = "off",
values = [
"off",
"instrumentation",
"walltime",
],
)
config_setting(
name = "instrumentation_mode",
flag_values = {":codspeed_mode": "instrumentation"},
)
config_setting(
name = "walltime_mode",
flag_values = {":codspeed_mode": "walltime"},
)