Skip to content

Commit 2972e91

Browse files
fixup! feat(google_benchmark): only run benchmark once in instrumentation mode
1 parent 25a77f9 commit 2972e91

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

google_benchmark/cmake/Codspeed.cmake

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,10 @@ if(NOT DEFINED CODSPEED_MODE)
2121
set(CODSPEED_MODE "instrumentation")
2222
endif()
2323
endif()
24-
25-
# Define a preprocessor macro based on the build mode
24+
message(
25+
FATAL_ERROR
26+
"Invalid build mode: ${CODSPEED_MODE}. Use 'instrumentation' or 'walltime'."
27+
)
2628
if(CODSPEED_MODE STREQUAL "instrumentation")
2729
target_compile_definitions(codspeed INTERFACE -DCODSPEED_INSTRUMENTATION)
2830
elseif(CODSPEED_MODE STREQUAL "walltime")
29-
target_compile_definitions(codspeed INTERFACE -DCODSPEED_WALLTIME)
30-
else()
31-
message(
32-
FATAL_ERROR
33-
"Invalid build mode: ${CODSPEED_MODE}. Use 'instrumentation' or 'walltime'."
34-
)
35-
endif()
36-
37-
message(STATUS "Build mode set to: ${CODSPEED_MODE}")

0 commit comments

Comments
 (0)