File tree 1 file changed +14
-1
lines changed 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -523,14 +523,27 @@ def mypycify(
523
523
# This flag is needed for gcc but does not exist on clang.
524
524
cflags += ['-Wno-unused-but-set-variable' ]
525
525
elif compiler .compiler_type == 'msvc' :
526
- if opt_level == '3' :
526
+ # msvc doesn't have levels, '/O2' is 'on' and '/Od' is disable
527
+ if opt_level == '0' :
528
+ opt_level = 'd'
529
+ elif opt_level in ('1' , '2' , '3' ):
527
530
opt_level = '2'
531
+ if debug_level == '0' :
532
+ cflags += ['/DEBUG:NONE' ]
533
+ elif debug_level == '1' :
534
+ cflags += ['/DEBUG:FASTLINK' ]
535
+ elif debug_level in ('2' , '3' ):
536
+ cflags += [
537
+ '/DEBUG:FULL' ,
538
+ '/Z7' , # full symbolic debugging information
539
+ ]
528
540
cflags += [
529
541
'/O{}' .format (opt_level ),
530
542
'/wd4102' , # unreferenced label
531
543
'/wd4101' , # unreferenced local variable
532
544
'/wd4146' , # negating unsigned int
533
545
]
546
+
534
547
if multi_file :
535
548
# Disable whole program optimization in multi-file mode so
536
549
# that we actually get the compilation speed and memory
You can’t perform that action at this time.
0 commit comments