mirror of
https://github.com/google/benchmark.git
synced 2025-01-30 13:50:15 +08:00
Add bazel target for benchmark_release (#1078)
Fixes google#1077 Bazel clients currently cannot build the benchmark library in Release mode. This commit adds a new target ":benchmark_release" to enable this.
This commit is contained in:
parent
378ed8ff25
commit
d8254bb9eb
22
BUILD.bazel
22
BUILD.bazel
@ -10,8 +10,8 @@ config_setting(
|
|||||||
visibility = [":__subpackages__"],
|
visibility = [":__subpackages__"],
|
||||||
)
|
)
|
||||||
|
|
||||||
cc_library(
|
filegroup(
|
||||||
name = "benchmark",
|
name = "benchmark_srcs",
|
||||||
srcs = glob(
|
srcs = glob(
|
||||||
[
|
[
|
||||||
"src/*.cc",
|
"src/*.cc",
|
||||||
@ -19,6 +19,11 @@ cc_library(
|
|||||||
],
|
],
|
||||||
exclude = ["src/benchmark_main.cc"],
|
exclude = ["src/benchmark_main.cc"],
|
||||||
),
|
),
|
||||||
|
)
|
||||||
|
|
||||||
|
cc_library(
|
||||||
|
name = "benchmark",
|
||||||
|
srcs = [":benchmark_srcs"],
|
||||||
hdrs = ["include/benchmark/benchmark.h"],
|
hdrs = ["include/benchmark/benchmark.h"],
|
||||||
linkopts = select({
|
linkopts = select({
|
||||||
":windows": ["-DEFAULTLIB:shlwapi.lib"],
|
":windows": ["-DEFAULTLIB:shlwapi.lib"],
|
||||||
@ -28,6 +33,19 @@ cc_library(
|
|||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
cc_library(
|
||||||
|
name = "benchmark_release",
|
||||||
|
srcs = [":benchmark_srcs"],
|
||||||
|
hdrs = ["include/benchmark/benchmark.h"],
|
||||||
|
defines = ["NDEBUG"],
|
||||||
|
linkopts = select({
|
||||||
|
":windows": ["-DEFAULTLIB:shlwapi.lib"],
|
||||||
|
"//conditions:default": ["-pthread"],
|
||||||
|
}),
|
||||||
|
strip_include_prefix = "include",
|
||||||
|
visibility = ["//visibility:public"],
|
||||||
|
)
|
||||||
|
|
||||||
cc_library(
|
cc_library(
|
||||||
name = "benchmark_main",
|
name = "benchmark_main",
|
||||||
srcs = ["src/benchmark_main.cc"],
|
srcs = ["src/benchmark_main.cc"],
|
||||||
|
Loading…
Reference in New Issue
Block a user