Skip to content

Commit 84f6816

Browse files
committed
v.builder: add -DNO_DEBUGGING in addition to -DNDEBUG, when compiling with -prod
1 parent 2b0af31 commit 84f6816

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

vlib/v/builder/cc.v

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,7 @@ fn (mut v Builder) setup_ccompiler_options(ccompiler string) {
302302
// have much better performance when NDEBUG is defined
303303
// See also http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf
304304
ccoptions.args << '-DNDEBUG'
305+
ccoptions.args << '-DNO_DEBUGGING' // for BDWGC
305306
}
306307
if v.pref.sanitize {
307308
ccoptions.args << '-fsanitize=leak'

vlib/v/builder/msvc_windows.v

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@ pub fn (mut v Builder) cc_msvc() {
291291
} else {
292292
a << '/MD'
293293
a << '/DNDEBUG'
294+
a << '/DNO_DEBUGGING'
294295
if !v.ccoptions.debug_mode {
295296
v.pref.cleanup_files << out_name_pdb
296297
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,
458459
oargs << '/O2'
459460
oargs << '/MD'
460461
oargs << '/DNDEBUG'
462+
oargs << '/DNO_DEBUGGING'
461463
}
462464
} else {
463465
oargs << '/MDd'

0 commit comments

Comments
 (0)