Skip to content

Build //:benchmark as a static library only. #1373

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,11 @@ cc_library(
":windows": [],
"//conditions:default": posix_copts,
}),
local_defines = select({
":windows": ["benchmark_EXPORTS"],
"//conditions:default": [],
}),
# 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"],
)

cc_library(
Expand Down
1 change: 0 additions & 1 deletion bindings/python/build_defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ def py_extension(name, srcs, hdrs = [], copts = [], features = [], deps = []):
copts = copts,
features = features,
deps = deps,
local_defines = ["BENCHMARK_STATIC_DEFINE"],
)

return native.py_library(
Expand Down