File tree Expand file tree Collapse file tree 1 file changed +7
-19
lines changed Expand file tree Collapse file tree 1 file changed +7
-19
lines changed Original file line number Diff line number Diff line change @@ -8,30 +8,18 @@ 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+ # Define a preprocessor macro based on the build mode
13+ if (CODSPEED_MODE STREQUAL "instrumentation" )
2714 target_compile_definitions (codspeed INTERFACE -DCODSPEED_INSTRUMENTATION)
28- elseif (CODSPEED_MODE STREQUAL "walltime" )
15+ elseif (CODSPEED_MODE STREQUAL "walltime" )
2916 target_compile_definitions (codspeed INTERFACE -DCODSPEED_WALLTIME)
30- else ()
17+ else ()
3118 message (
32- FATAL_ERROR
19+ FATAL_ERROR
3320 "Invalid build mode: ${CODSPEED_MODE} . Use 'instrumentation' or 'walltime'."
3421 )
22+ endif ()
3523endif ()
3624
3725message (STATUS "Build mode set to: ${CODSPEED_MODE} " )
You can’t perform that action at this time.
0 commit comments