2020-08-28 07:46:12 +00:00
|
|
|
load("@rules_cc//cc:defs.bzl", "cc_library")
|
|
|
|
|
2018-03-08 12:48:46 +00:00
|
|
|
licenses(["notice"])
|
|
|
|
|
2018-05-01 14:24:38 +00:00
|
|
|
config_setting(
|
|
|
|
name = "windows",
|
2020-09-03 09:59:15 +00:00
|
|
|
values = {
|
|
|
|
"cpu": "x64_windows",
|
|
|
|
},
|
2018-05-01 14:24:38 +00:00
|
|
|
visibility = [":__subpackages__"],
|
|
|
|
)
|
|
|
|
|
2020-12-22 09:54:33 +00:00
|
|
|
filegroup(
|
|
|
|
name = "benchmark_srcs",
|
2018-05-25 10:18:58 +00:00
|
|
|
srcs = glob(
|
|
|
|
[
|
|
|
|
"src/*.cc",
|
|
|
|
"src/*.h",
|
|
|
|
],
|
|
|
|
exclude = ["src/benchmark_main.cc"],
|
|
|
|
),
|
2020-12-22 09:54:33 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "benchmark",
|
|
|
|
srcs = [":benchmark_srcs"],
|
|
|
|
hdrs = ["include/benchmark/benchmark.h"],
|
|
|
|
linkopts = select({
|
|
|
|
":windows": ["-DEFAULTLIB:shlwapi.lib"],
|
|
|
|
"//conditions:default": ["-pthread"],
|
|
|
|
}),
|
|
|
|
strip_include_prefix = "include",
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "benchmark_release",
|
|
|
|
srcs = [":benchmark_srcs"],
|
2018-03-08 12:48:46 +00:00
|
|
|
hdrs = ["include/benchmark/benchmark.h"],
|
2020-12-22 09:54:33 +00:00
|
|
|
defines = ["NDEBUG"],
|
2018-05-01 14:24:38 +00:00
|
|
|
linkopts = select({
|
2018-05-02 10:23:18 +00:00
|
|
|
":windows": ["-DEFAULTLIB:shlwapi.lib"],
|
2018-05-01 14:24:38 +00:00
|
|
|
"//conditions:default": ["-pthread"],
|
|
|
|
}),
|
2018-03-08 12:48:46 +00:00
|
|
|
strip_include_prefix = "include",
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
|
|
|
|
2018-05-25 10:18:58 +00: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 12:48:46 +00:00
|
|
|
cc_library(
|
|
|
|
name = "benchmark_internal_headers",
|
|
|
|
hdrs = glob(["src/*.h"]),
|
|
|
|
visibility = ["//test:__pkg__"],
|
|
|
|
)
|