File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,15 @@ target_compile_definitions(
2323 INTERFACE -DCODSPEED_GIT_ROOT_DIR="${GIT_ROOT_DIR} "
2424)
2525
26- if (DEFINED CODSPEED_MODE)
26+ # Define CODSPEED_MODE as a CMake option with a default value
27+ option (
28+ CODSPEED_MODE
29+ "Build mode for Codspeed: instrumentation, walltime or OFF (default)"
30+ "OFF"
31+ )
32+
33+ # Validate the CODSPEED_MODE option
34+ if (NOT CODSPEED_MODE STREQUAL "OFF" )
2735 target_compile_definitions (codspeed INTERFACE -DCODSPEED_ENABLED)
2836 # Define a preprocessor macro based on the build mode
2937 if (CODSPEED_MODE STREQUAL "instrumentation" )
@@ -41,4 +49,4 @@ if(DEFINED CODSPEED_MODE)
4149 endif ()
4250endif ()
4351
44- message (STATUS "Build mode set to : ${CODSPEED_MODE} " )
52+ message (STATUS "Codspeed mode: ${CODSPEED_MODE} " )
You can’t perform that action at this time.
0 commit comments