Source release v3.3.0
This commit is contained in:
21
third_party/gyp/msvs_emulation.py
vendored
21
third_party/gyp/msvs_emulation.py
vendored
@@ -30,6 +30,10 @@ def QuoteForRspFile(arg):
|
||||
# works more or less because most programs (including the compiler, etc.)
|
||||
# use that function to handle command line arguments.
|
||||
|
||||
# Use a heuristic to try to find args that are paths, and normalize them
|
||||
if arg.find('/') > 0 or arg.count('/') > 1:
|
||||
arg = os.path.normpath(arg)
|
||||
|
||||
# For a literal quote, CommandLineToArgvW requires 2n+1 backslashes
|
||||
# preceding it, and results in n backslashes + the quote. So we substitute
|
||||
# in 2* what we match, +1 more, plus the quote.
|
||||
@@ -269,7 +273,8 @@ class MsvsSettings(object):
|
||||
def AdjustLibraries(self, libraries):
|
||||
"""Strip -l from library if it's specified with that."""
|
||||
libs = [lib[2:] if lib.startswith('-l') else lib for lib in libraries]
|
||||
return [lib + '.lib' if not lib.endswith('.lib') else lib for lib in libs]
|
||||
return [lib + '.lib' if not lib.lower().endswith('.lib') else lib
|
||||
for lib in libs]
|
||||
|
||||
def _GetAndMunge(self, field, path, default, prefix, append, map):
|
||||
"""Retrieve a value from |field| at |path| or return |default|. If
|
||||
@@ -306,7 +311,10 @@ class MsvsSettings(object):
|
||||
# There's two levels of architecture/platform specification in VS. The
|
||||
# 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_x64'), and a second target-specific configuration, which is an
|
||||
# 'Release'), VS2015 and later only use this level
|
||||
if 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
|
||||
# account the local target-specific overrides to the global configuration.
|
||||
arch = self.GetArch(config)
|
||||
@@ -468,8 +476,10 @@ class MsvsSettings(object):
|
||||
prefix='/arch:')
|
||||
cflags.extend(['/FI' + f for f in self._Setting(
|
||||
('VCCLCompilerTool', 'ForcedIncludeFiles'), config, default=[])])
|
||||
if self.vs_version.short_name in ('2013', '2013e', '2015'):
|
||||
# New flag required in 2013 to maintain previous PDB behavior.
|
||||
if 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
|
||||
cflags.append('/FS')
|
||||
# ninja handles parallelism by itself, don't have the compiler do it too.
|
||||
cflags = filter(lambda x: not x.startswith('/MP'), cflags)
|
||||
@@ -529,7 +539,8 @@ class MsvsSettings(object):
|
||||
"""Returns the .def file from sources, if any. Otherwise returns None."""
|
||||
spec = self.spec
|
||||
if spec['type'] in ('shared_library', 'loadable_module', 'executable'):
|
||||
def_files = [s for s in spec.get('sources', []) if s.endswith('.def')]
|
||||
def_files = [s for s in spec.get('sources', [])
|
||||
if s.lower().endswith('.def')]
|
||||
if len(def_files) == 1:
|
||||
return gyp_to_build_path(def_files[0])
|
||||
elif len(def_files) > 1:
|
||||
|
||||
Reference in New Issue
Block a user