set library version in bazel (#1746)

* set library version in bazel
This commit is contained in:
dominic 2024-01-29 13:48:04 +00:00 committed by GitHub
parent 17bc235ab3
commit 30a37e1b0b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 7 deletions

View File

@ -51,6 +51,7 @@ cc_library(
}),
defines = [
"BENCHMARK_STATIC_DEFINE",
"BENCHMARK_VERSION=\\\"" + (module_version() if module_version() != None else "") + "\\\"",
] + select({
":perfcounters": ["HAVE_LIBPFM"],
"//conditions:default": [],

View File

@ -748,13 +748,7 @@ int InitializeStreams() {
} // end namespace internal
std::string GetBenchmarkVersiom() {
#if defined(BENCHMARK_VERSION)
return {BENCHMARK_VERSION};
#else
return "hello, bazel!";
#endif
}
std::string GetBenchmarkVersiom() { return {BENCHMARK_VERSION}; }
void PrintDefaultHelp() {
fprintf(stdout,