Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion mypyc/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -523,10 +523,20 @@ def mypycify(
# This flag is needed for gcc but does not exist on clang.
cflags += ['-Wno-unused-but-set-variable']
elif compiler.compiler_type == 'msvc':
if opt_level == '3':
# msvc doesn't have levels, '/O2' is full and '/Od' is disable
if opt_level == '0':
opt_level = 'd'
elif opt_level in ('1', '2', '3'):
opt_level = '2'
if debug_level == '0':
debug_level = "NONE"
elif debug_level == '1':
debug_level = "FASTLINK"
elif debug_level in ('2', '3'):
debug_level = "FULL"
cflags += [
'/O{}'.format(opt_level),
f'/DEBUG:{debug_level}',
'/wd4102', # unreferenced label
'/wd4101', # unreferenced local variable
'/wd4146', # negating unsigned int
Expand Down