From 84f68168ed777ee17847f446c65bcc20d618bb73 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Sun, 7 Sep 2025 14:32:12 +0300 Subject: [PATCH] v.builder: add -DNO_DEBUGGING in addition to -DNDEBUG, when compiling with -prod --- vlib/v/builder/cc.v | 1 + vlib/v/builder/msvc_windows.v | 2 ++ 2 files changed, 3 insertions(+) diff --git a/vlib/v/builder/cc.v b/vlib/v/builder/cc.v index d3f6e54642..fae4c06173 100644 --- a/vlib/v/builder/cc.v +++ b/vlib/v/builder/cc.v @@ -302,6 +302,7 @@ fn (mut v Builder) setup_ccompiler_options(ccompiler string) { // have much better performance when NDEBUG is defined // See also http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf ccoptions.args << '-DNDEBUG' + ccoptions.args << '-DNO_DEBUGGING' // for BDWGC } if v.pref.sanitize { ccoptions.args << '-fsanitize=leak' diff --git a/vlib/v/builder/msvc_windows.v b/vlib/v/builder/msvc_windows.v index efabe1048f..1685613ade 100644 --- a/vlib/v/builder/msvc_windows.v +++ b/vlib/v/builder/msvc_windows.v @@ -291,6 +291,7 @@ pub fn (mut v Builder) cc_msvc() { } else { a << '/MD' a << '/DNDEBUG' + a << '/DNO_DEBUGGING' if !v.ccoptions.debug_mode { v.pref.cleanup_files << out_name_pdb v.pref.cleanup_files << app_dir_out_name + '.pdb' @@ -458,6 +459,7 @@ fn (mut v Builder) build_thirdparty_obj_file_with_msvc(_mod string, path string, oargs << '/O2' oargs << '/MD' oargs << '/DNDEBUG' + oargs << '/DNO_DEBUGGING' } } else { oargs << '/MDd'