diff --git a/cpp/bench/CMakeLists.txt b/cpp/bench/CMakeLists.txt index 749e394..6b75401 100644 --- a/cpp/bench/CMakeLists.txt +++ b/cpp/bench/CMakeLists.txt @@ -19,8 +19,8 @@ FetchContent_Declare( ) FetchContent_MakeAvailable(google-benchmark) -add_executable(bench-naive naive.cpp) -target_link_libraries(bench-naive src-lib benchmark::benchmark_main) +add_executable(bench-naive naive.cpp main-no-log.cpp) +target_link_libraries(bench-naive src-lib benchmark::benchmark) if (ENABLE_CILK) add_executable(bench-fftw-cilk fftw-cilk.cpp) diff --git a/cpp/bench/main-no-log.cpp b/cpp/bench/main-no-log.cpp new file mode 100644 index 0000000..093e310 --- /dev/null +++ b/cpp/bench/main-no-log.cpp @@ -0,0 +1,14 @@ +#include +#include +#include + + +int main(int argc, char **argv) { + // No logging in benchmarks (unless overridden via environment variable) + spdlog::set_level(spdlog::level::off); + spdlog::cfg::load_env_levels(); + + benchmark::Initialize(&argc, argv); + benchmark::RunSpecifiedBenchmarks(); + benchmark::Shutdown(); +} \ No newline at end of file