2018-03-08 20:48:46 +08:00
|
|
|
licenses(["notice"])
|
|
|
|
|
2021-06-28 20:46:08 +08:00
|
|
|
config_setting(
|
|
|
|
name = "qnx",
|
|
|
|
constraint_values = ["@platforms//os:qnx"],
|
|
|
|
values = {
|
|
|
|
"cpu": "x64_qnx",
|
|
|
|
},
|
|
|
|
visibility = [":__subpackages__"],
|
|
|
|
)
|
|
|
|
|
2018-05-01 22:24:38 +08:00
|
|
|
config_setting(
|
|
|
|
name = "windows",
|
2021-06-28 20:46:08 +08:00
|
|
|
constraint_values = ["@platforms//os:windows"],
|
2020-09-03 17:59:15 +08:00
|
|
|
values = {
|
|
|
|
"cpu": "x64_windows",
|
|
|
|
},
|
2018-05-01 22:24:38 +08:00
|
|
|
visibility = [":__subpackages__"],
|
|
|
|
)
|
|
|
|
|
2021-01-05 17:54:04 +08:00
|
|
|
cc_library(
|
|
|
|
name = "benchmark",
|
2018-05-25 18:18:58 +08:00
|
|
|
srcs = glob(
|
|
|
|
[
|
|
|
|
"src/*.cc",
|
|
|
|
"src/*.h",
|
|
|
|
],
|
|
|
|
exclude = ["src/benchmark_main.cc"],
|
|
|
|
),
|
2022-02-14 18:48:53 +08:00
|
|
|
hdrs = [
|
|
|
|
"include/benchmark/benchmark.h",
|
2022-07-26 16:00:49 +08:00
|
|
|
"include/benchmark/export.h",
|
2022-02-14 18:48:53 +08:00
|
|
|
],
|
2018-05-01 22:24:38 +08:00
|
|
|
linkopts = select({
|
2018-05-02 18:23:18 +08:00
|
|
|
":windows": ["-DEFAULTLIB:shlwapi.lib"],
|
2018-05-01 22:24:38 +08:00
|
|
|
"//conditions:default": ["-pthread"],
|
|
|
|
}),
|
2018-03-08 20:48:46 +08:00
|
|
|
strip_include_prefix = "include",
|
|
|
|
visibility = ["//visibility:public"],
|
2022-03-17 16:47:45 +08:00
|
|
|
# Only static linking is allowed; no .so will be produced.
|
|
|
|
# Using `defines` (i.e. not `local_defines`) means that no
|
|
|
|
# dependent rules need to bother about defining the macro.
|
|
|
|
linkstatic = True,
|
|
|
|
defines = ["BENCHMARK_STATIC_DEFINE"],
|
2018-03-08 20:48:46 +08:00
|
|
|
)
|
|
|
|
|
2018-05-25 18:18:58 +08:00
|
|
|
cc_library(
|
|
|
|
name = "benchmark_main",
|
|
|
|
srcs = ["src/benchmark_main.cc"],
|
2022-07-26 16:00:49 +08:00
|
|
|
hdrs = ["include/benchmark/benchmark.h", "include/benchmark/export.h"],
|
2018-05-25 18:18:58 +08:00
|
|
|
strip_include_prefix = "include",
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
deps = [":benchmark"],
|
|
|
|
)
|
|
|
|
|
2018-03-08 20:48:46 +08:00
|
|
|
cc_library(
|
|
|
|
name = "benchmark_internal_headers",
|
|
|
|
hdrs = glob(["src/*.h"]),
|
|
|
|
visibility = ["//test:__pkg__"],
|
|
|
|
)
|