Skip to content

Commit

Permalink
fix: build failure with ninja and Python 3 on Windows (#113)
Browse files Browse the repository at this point in the history
  • Loading branch information
Cheng Zhao committed Jul 7, 2021
1 parent 45475a7 commit c172d10
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
1 change: 0 additions & 1 deletion pylib/gyp/generator/ninja.py
Expand Up @@ -2389,7 +2389,6 @@ def GenerateOutputForConfig(target_list, target_dicts, data, params, config_name
)
if flavor == "win":
master_ninja.variable("ld_host", ld_host)
master_ninja.variable("ldxx_host", ldxx_host)
else:
master_ninja.variable(
"ld_host", CommandWithWrapper("LINK", wrappers, ld_host)
Expand Down
4 changes: 2 additions & 2 deletions pylib/gyp/msvs_emulation.py
Expand Up @@ -333,7 +333,7 @@ def _TargetConfig(self, config):
# first level is globally for the configuration (this is what we consider
# "the" config at the gyp level, which will be something like 'Debug' or
# 'Release'), VS2015 and later only use this level
if self.vs_version.short_name >= 2015:
if int(self.vs_version.short_name) >= 2015:
return config
# and a second target-specific configuration, which is an
# override for the global one. |config| is remapped here to take into
Expand Down Expand Up @@ -537,7 +537,7 @@ def GetCflags(self, config):
)
]
)
if self.vs_version.project_version >= 12.0:
if float(self.vs_version.project_version) >= 12.0:
# New flag introduced in VS2013 (project version 12.0) Forces writes to
# the program database (PDB) to be serialized through MSPDBSRV.EXE.
# https://msdn.microsoft.com/en-us/library/dn502518.aspx
Expand Down
5 changes: 3 additions & 2 deletions pylib/gyp/win_tool.py
Expand Up @@ -221,8 +221,9 @@ def ExecLinkWithManifests(
# and sometimes doesn't unfortunately.
with open(our_manifest) as our_f:
with open(assert_manifest) as assert_f:
our_data = our_f.read().translate(None, string.whitespace)
assert_data = assert_f.read().translate(None, string.whitespace)
translator = str.maketrans('', '', string.whitespace)
our_data = our_f.read().translate(translator)
assert_data = assert_f.read().translate(translator)
if our_data != assert_data:
os.unlink(out)

Expand Down

0 comments on commit c172d10

Please sign in to comment.