Skip to content

Commit 86bd6f9

Browse files
fixup! feat(google_benchmark): add file name to benchmark URI
1 parent b421468 commit 86bd6f9

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

google_benchmark/cmake/Codspeed.cmake

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,15 @@ target_compile_definitions(
1111
INTERFACE -DCODSPEED_GIT_ROOT_DIR="${GIT_ROOT_DIR}"
1212
)
1313

14-
# Step 1: Check if CODSPEED_MODE is set via the command line
15-
16-
# CMake cache kind of breaks this mechanism, keeping it for first time
17-
# defaulting
18-
if(NOT DEFINED CODSPEED_MODE)
19-
# Step 2: Check the environment variable CODSPEED_MODE
20-
if(DEFINED $ENV{CODSPEED_RUNNER_MODE})
21-
set(CODSPEED_MODE $ENV{CODSPEED_RUNNER_MODE} FORCE)
14+
if(DEFINED CODSPEED_MODE)
15+
# Define a preprocessor macro based on the build mode
16+
if(CODSPEED_MODE STREQUAL "instrumentation")
17+
target_compile_definitions(
18+
codspeed
19+
INTERFACE -DCODSPEED_INSTRUMENTATION
20+
)
21+
elseif(CODSPEED_MODE STREQUAL "walltime")
22+
target_compile_definitions(codspeed INTERFACE -DCODSPEED_WALLTIME)
2223
else()
2324
# Step 3: Default to "instrumentation" if no value is provided
2425
set(CODSPEED_MODE "instrumentation")

0 commit comments

Comments
 (0)