2020-08-28 15:46:12 +08:00
|
|
|
load("@rules_cc//cc:defs.bzl", "cc_library")
|
|
|
|
|
2018-03-08 20:48:46 +08:00
|
|
|
licenses(["notice"])
|
|
|
|
|
2018-05-01 22:24:38 +08:00
|
|
|
config_setting(
|
|
|
|
name = "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"],
|
|
|
|
),
|
2018-03-08 20:48:46 +08:00
|
|
|
hdrs = ["include/benchmark/benchmark.h"],
|
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"],
|
|
|
|
)
|
|
|
|
|
2018-05-25 18:18:58 +08:00
|
|
|
cc_library(
|
|
|
|
name = "benchmark_main",
|
|
|
|
srcs = ["src/benchmark_main.cc"],
|
|
|
|
hdrs = ["include/benchmark/benchmark.h"],
|
|
|
|
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__"],
|
|
|
|
)
|