File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,14 @@ 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+ )
31+
32+ # Validate the CODSPEED_MODE option
33+ if (NOT CODSPEED_MODE STREQUAL "OFF" )
2734 target_compile_definitions (codspeed INTERFACE -DCODSPEED_ENABLED)
2835 # Define a preprocessor macro based on the build mode
2936 if (CODSPEED_MODE STREQUAL "instrumentation" )
@@ -41,4 +48,4 @@ if(DEFINED CODSPEED_MODE)
4148 endif ()
4249endif ()
4350
44- message (STATUS "Build mode set to : ${CODSPEED_MODE} " )
51+ message (STATUS "Codspeed mode: ${CODSPEED_MODE} " )
You can’t perform that action at this time.
0 commit comments