File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff 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" )
You can’t perform that action at this time.
0 commit comments