summaryrefslogtreecommitdiff
path: root/tools/gyp/pylib/gyp/generator/msvs.py
diff options
context:
space:
mode:
authorRefael Ackermann <refack@gmail.com>2017-08-09 14:43:18 -0400
committerRefael Ackermann <refack@gmail.com>2017-08-23 16:24:28 -0400
commit327077ce43866020eadaf3b58f7280a09ed0c348 (patch)
tree04002b9263e8c89a2402af3243d7910f8abe76c2 /tools/gyp/pylib/gyp/generator/msvs.py
parent01160dd6e901c7b3e70508c16bd8654e312d8486 (diff)
downloadandroid-node-v8-327077ce43866020eadaf3b58f7280a09ed0c348.tar.gz
android-node-v8-327077ce43866020eadaf3b58f7280a09ed0c348.tar.bz2
android-node-v8-327077ce43866020eadaf3b58f7280a09ed0c348.zip
tools: update GYP to 324dd166
PR-URL: https://github.com/nodejs/node/pull/14718 Refs: https://chromium.googlesource.com/external/gyp/+/324dd166b7c0b39d513026fa52d6280ac6d56770 Refs: https://github.com/refack/GYP/commit/324dd166b7c0b39d513026fa52d6280ac6d56770 Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'tools/gyp/pylib/gyp/generator/msvs.py')
-rw-r--r--tools/gyp/pylib/gyp/generator/msvs.py29
1 files changed, 21 insertions, 8 deletions
diff --git a/tools/gyp/pylib/gyp/generator/msvs.py b/tools/gyp/pylib/gyp/generator/msvs.py
index ab92979e5c..8fe9e5af23 100644
--- a/tools/gyp/pylib/gyp/generator/msvs.py
+++ b/tools/gyp/pylib/gyp/generator/msvs.py
@@ -306,9 +306,19 @@ def _ConfigWindowsTargetPlatformVersion(config_data, version):
continue
version = MSVSVersion._RegistryGetValue(key % ver, 'ProductVersion') or ''
# Find a matching entry in sdk_dir\include.
- names = sorted([x for x in os.listdir(r'%s\include' % sdk_dir)
+ expected_sdk_dir=r'%s\include' % sdk_dir
+ names = sorted([x for x in (os.listdir(expected_sdk_dir)
+ if os.path.isdir(expected_sdk_dir)
+ else []
+ )
if x.startswith(version)], reverse=True)
- return names[0]
+ if names:
+ return names[0]
+ else:
+ print >> sys.stdout, (
+ 'Warning: No include files found for '
+ 'detected Windows SDK version %s' % (version)
+ )
def _BuildCommandLineForRuleRaw(spec, cmd, cygwin_shell, has_input_path,
@@ -1717,14 +1727,17 @@ def _GetCopies(spec):
src_bare = src[:-1]
base_dir = posixpath.split(src_bare)[0]
outer_dir = posixpath.split(src_bare)[1]
- cmd = 'cd "%s" && xcopy /e /f /y "%s" "%s\\%s\\"' % (
- _FixPath(base_dir), outer_dir, _FixPath(dst), outer_dir)
+ fixed_dst = _FixPath(dst)
+ full_dst = '"%s\\%s\\"' % (fixed_dst, outer_dir)
+ cmd = 'mkdir %s 2>nul & cd "%s" && xcopy /e /f /y "%s" %s' % (
+ full_dst, _FixPath(base_dir), outer_dir, full_dst)
copies.append(([src], ['dummy_copies', dst], cmd,
- 'Copying %s to %s' % (src, dst)))
+ 'Copying %s to %s' % (src, fixed_dst)))
else:
+ fix_dst = _FixPath(cpy['destination'])
cmd = 'mkdir "%s" 2>nul & set ERRORLEVEL=0 & copy /Y "%s" "%s"' % (
- _FixPath(cpy['destination']), _FixPath(src), _FixPath(dst))
- copies.append(([src], [dst], cmd, 'Copying %s to %s' % (src, dst)))
+ fix_dst, _FixPath(src), _FixPath(dst))
+ copies.append(([src], [dst], cmd, 'Copying %s to %s' % (src, fix_dst)))
return copies
@@ -2718,7 +2731,7 @@ def _GetMSBuildGlobalProperties(spec, version, guid, gyp_file_name):
properties[0].append(['WindowsTargetPlatformVersion',
str(msvs_windows_sdk_version)])
elif version.compatible_sdks:
- raise GypError('%s requires any SDK of %o version, but non were found' %
+ raise GypError('%s requires any SDK of %s version, but none were found' %
(version.description, version.compatible_sdks))
if platform_name == 'ARM':