Add -DNDEBUG to benchmark builds

The benchmark library warns "Library was built as DEBUG" without NDEBUG.
This enables debug assertions and disables optimizations in the benchmark
framework, causing instrumentation overhead to show up in profiles.
This commit is contained in:
J. Nick Koston
2026-03-16 22:03:16 -10:00
parent 6b88820400
commit ea5f62f030
2 changed files with 2 additions and 0 deletions
+1
View File
@@ -53,6 +53,7 @@ def run_benchmarks(selected_components: list[str], build_only: bool = False) ->
# CODSPEED_ROOT_DIR is used to display relative file paths in reports.
project_root = Path(__file__).resolve().parent.parent
codspeed_flags = [
"-DNDEBUG",
"-DCODSPEED_ENABLED",
"-DCODSPEED_ANALYSIS",
f'-DCODSPEED_ROOT_DIR=\\"{project_root}\\"',