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,