From d4d344b39bcec368dc2c5c64e32d8cf563d9667b Mon Sep 17 00:00:00 2001 From: Roman Lebedev Date: Wed, 24 Jan 2024 15:38:03 +0300 Subject: [PATCH] Support bazel? --- BUILD.bazel | 1 + src/benchmark.cc | 8 +------- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/BUILD.bazel b/BUILD.bazel index 0178e2c009..2ee0cb57e2 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -68,6 +68,7 @@ cc_library( "_FILE_OFFSET_BITS=64", "_LARGEFILE64_SOURCE", "_LARGEFILE_SOURCE", + "BENCHMARK_VERSION=\""+module_version()+"\"", ], strip_include_prefix = "include", visibility = ["//visibility:public"], diff --git a/src/benchmark.cc b/src/benchmark.cc index 489c8a0a4f..8ec30c88c0 100644 --- a/src/benchmark.cc +++ b/src/benchmark.cc @@ -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,