10000 mypyc build: when windows use correct optimization and debug flags by KotlinIsland · Pull Request #12468 · python/mypy · GitHub
[go: up one dir, main page]

Skip to content

mypyc build: when windows use correct optimization and debug flags #12468

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 28, 2022
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'
60F7 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
0