File tree Expand file tree Collapse file tree 5 files changed +23
-4
lines changed
examples/google_benchmark_cmake
google_benchmark/include/benchmark Expand file tree Collapse file tree 5 files changed +23
-4
lines changed Original file line number Diff line number Diff line change 5656 key : ${{ runner.os }}-build-${{ matrix.codspeed-mode }}-${{ hashFiles('**/CMakeLists.txt') }}
5757
5858 - name : Create build directory
59- run : mkdir examples\google_benchmark_cmake\build
59+ run : |
60+ if (-not (Test-Path examples\google_benchmark_cmake\build)) {
61+ mkdir examples\google_benchmark_cmake\build
62+ }
6063 shell : pwsh
6164
6265 - name : Build benchmark example
Original file line number Diff line number Diff line change 11#ifndef CODSPEED_H
22#define CODSPEED_H
33
4+ #include < cstdint>
45#include < string>
56#include < vector>
67
@@ -33,7 +34,7 @@ class CodSpeed {
3334struct RawWalltimeBenchmark {
3435 std::string name;
3536 std::string uri;
36- long iter_per_round;
37+ int64_t iter_per_round;
3738 double mean_ns;
3839 double median_ns;
3940 double stdev_ns;
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ struct BenchmarkStats {
3131 double total_time;
3232 uint64_t iqr_outlier_rounds;
3333 uint64_t stdev_outlier_rounds;
34- long iter_per_round;
34+ int64_t iter_per_round;
3535 uint64_t warmup_iters;
3636};
3737
Original file line number Diff line number Diff line change @@ -6,12 +6,16 @@ project(codspeed_picobench_compat VERSION 0.0.0 LANGUAGES CXX)
66# Treat warnings as errors
77if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang" )
88 add_compile_options (-Wall -Wextra -Werror)
9+ elseif (MSVC )
10+ add_compile_options (/W4 /WX)
911endif ()
1012
1113# On the small benchmarks of this repo, most of the benches will be optimized out, but this is expected.
1214set (CMAKE_BUILD_TYPE RelWithDebInfo)
1315
14- option (BENCHMARK_ENABLE_GTEST_TESTS OFF )
16+ # Disable Google Benchmark tests
17+ set (BENCHMARK_ENABLE_GTEST_TESTS OFF CACHE BOOL "Enable testing of the benchmark library." FORCE)
18+ set (BENCHMARK_ENABLE_TESTING OFF CACHE BOOL "Enable testing of the benchmark library." FORCE)
1519
1620FetchContent_Declare(
1721 google_benchmark
Original file line number Diff line number Diff line change @@ -1459,16 +1459,27 @@ class Fixture : public internal::Benchmark {
14591459#define BENCHMARK_PRIVATE_CONCAT_NAME (BaseClass, Method ) \
14601460 BaseClass##_##Method##_Benchmark
14611461
1462+ #ifdef _MSC_VER
1463+ #define BENCHMARK_PRIVATE_DECLARE (n ) \
1464+ /* NOLINTNEXTLINE(misc-use-anonymous-namespace) */ \
1465+ static ::benchmark::internal::Benchmark const * const BENCHMARK_PRIVATE_NAME ( \
1466+ n)
1467+ #else
14621468#define BENCHMARK_PRIVATE_DECLARE (n ) \
14631469 /* NOLINTNEXTLINE(misc-use-anonymous-namespace) */ \
14641470 static ::benchmark::internal::Benchmark const * const BENCHMARK_PRIVATE_NAME ( \
14651471 n) [[maybe_unused]]
1472+ #endif
14661473
14671474#ifdef CODSPEED_ENABLED
14681475#define CUR_FILE \
14691476 codspeed::get_path_relative_to_workspace (__FILE__) + "::"
1477+ #ifdef _MSC_VER
1478+ #define NAMESPACE std::string (" " )
1479+ #else
14701480#define NAMESPACE \
14711481 (([]() { return codspeed::extract_lambda_namespace (__PRETTY_FUNCTION__); })())
1482+ #endif
14721483#define STATIC_NAMESPACE_STRING (name ) static std::string name = NAMESPACE;
14731484
14741485#define FILE_AND_NAMESPACE CUR_FILE + NAMESPACE
You can’t perform that action at this time.
0 commit comments