File tree Expand file tree Collapse file tree 1 file changed +8
-19
lines changed Expand file tree Collapse file tree 1 file changed +8
-19
lines changed Original file line number Diff line number Diff line change @@ -8,30 +8,19 @@ execute_process(
88target_compile_definitions (codspeed
99 INTERFACE -DCODSPEED_GIT_ROOT_DIR="${GIT_ROOT_DIR} " )
1010
11- # Step 1: Check if CODSPEED_MODE is set via the command line
12-
13- # CMake cache kind of breaks this mechanism, keeping it for first time
14- # defaulting
15- if (NOT DEFINED CODSPEED_MODE)
16- # Step 2: Check the environment variable CODSPEED_MODE
17- if (DEFINED $ENV{CODSPEED_RUNNER_MODE} )
18- set (CODSPEED_MODE $ENV{CODSPEED_RUNNER_MODE} FORCE)
19- else ()
20- # Step 3: Default to "instrumentation" if no value is provided
21- set (CODSPEED_MODE "instrumentation" )
22- endif ()
23- endif ()
24-
25- # Define a preprocessor macro based on the build mode
26- if (CODSPEED_MODE STREQUAL "instrumentation" )
11+ if (DEFINED CODSPEED_MODE)
12+ target_compile_definitions (codspeed INTERFACE -DCODSPEED_ENABLED)
13+ # Define a preprocessor macro based on the build mode
14+ if (CODSPEED_MODE STREQUAL "instrumentation" )
2715 target_compile_definitions (codspeed INTERFACE -DCODSPEED_INSTRUMENTATION)
28- elseif (CODSPEED_MODE STREQUAL "walltime" )
16+ elseif (CODSPEED_MODE STREQUAL "walltime" )
2917 target_compile_definitions (codspeed INTERFACE -DCODSPEED_WALLTIME)
30- else ()
18+ else ()
3119 message (
32- FATAL_ERROR
20+ FATAL_ERROR
3321 "Invalid build mode: ${CODSPEED_MODE} . Use 'instrumentation' or 'walltime'."
3422 )
23+ endif ()
3524endif ()
3625
3726message (STATUS "Build mode set to: ${CODSPEED_MODE} " )
You can’t perform that action at this time.
0 commit comments