Skip to content

Commit 36044f3

Browse files
authored
incorporate python#31017's win32 conditional and flags
1 parent efbb649 commit 36044f3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Tools/peg_generator/pegen/build.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import itertools
22
import pathlib
33
import shutil
4+
import sys
45
import sysconfig
56
import tempfile
67
import tokenize
@@ -63,7 +64,11 @@ def compile_c_extension(
6364
if keep_asserts:
6465
extra_compile_args.append("-UNDEBUG")
6566
if disable_optimization:
66-
extra_compile_args.append("-O0")
67+
if sys.platform == 'win32':
68+
extra_compile_args.append("/Od")
69+
extra_link_args.append("/LTCG:OFF")
70+
else:
71+
extra_compile_args.append("-O0")
6772
extension = [
6873
Extension(
6974
extension_name,

0 commit comments

Comments
 (0)