Skip to content

Commit 389a0df

Browse files
committed
tools: update gyp to 702ac58
1 parent 33e598a commit 389a0df

21 files changed

+1069
-300
lines changed

tools/gyp/AUTHORS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@ Steven Knight <[email protected]>
99
Ryan Norton <[email protected]>
1010
David J. Sankel <[email protected]>
1111
Eric N. Vander Weele <[email protected]>
12+
Tom Freudenberg <[email protected]>
13+
Julien Brianceau <[email protected]>

tools/gyp/DEPS

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
# (You don't need to use gclient for normal GYP development work.)
44

55
vars = {
6-
"chrome_trunk": "http://src.chromium.org/svn/trunk",
7-
"googlecode_url": "http://%s.googlecode.com/svn",
6+
"chromium_git": "https://chromium.googlesource.com/",
87
}
98

109
deps = {
@@ -13,12 +12,12 @@ deps = {
1312
deps_os = {
1413
"win": {
1514
"third_party/cygwin":
16-
Var("chrome_trunk") + "/deps/third_party/cygwin@66844",
15+
Var("chromium_git") + "chromium/deps/cygwin@4fbd5b9",
1716

1817
"third_party/python_26":
19-
Var("chrome_trunk") + "/tools/third_party/python_26@89111",
18+
Var("chromium_git") + "chromium/deps/python_26@5bb4080",
2019

2120
"src/third_party/pefile":
22-
(Var("googlecode_url") % "pefile") + "/trunk@63",
21+
Var("chromium_git") + "external/pefile@72c6ae4",
2322
},
2423
}

tools/gyp/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
GYP can Generate Your Projects.
2+
===================================
3+
4+
Documents are available at [gyp.gsrc.io](https://gyp.gsrc.io), or you can check out ```md-pages``` branch to read those documents offline.

tools/gyp/pylib/gyp/MSVSSettings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,7 @@ def _ValidateSettings(validators, settings, stderr):
592592
_Same(_compile, 'UseFullPaths', _boolean) # /FC
593593
_Same(_compile, 'WholeProgramOptimization', _boolean) # /GL
594594
_Same(_compile, 'XMLDocumentationFileName', _file_name)
595+
_Same(_compile, 'CompileAsWinRT', _boolean) # /ZW
595596

596597
_Same(_compile, 'AssemblerOutput',
597598
_Enumeration(['NoListing',

tools/gyp/pylib/gyp/MSVSUtil.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
'loadable_module': 'dll',
1515
'shared_library': 'dll',
1616
'static_library': 'lib',
17+
'windows_driver': 'sys',
1718
}
1819

1920

@@ -110,7 +111,7 @@ def ShardTargets(target_list, target_dicts):
110111
else:
111112
new_target_dicts[t] = target_dicts[t]
112113
# Shard dependencies.
113-
for t in new_target_dicts:
114+
for t in sorted(new_target_dicts):
114115
for deptype in ('dependencies', 'dependencies_original'):
115116
dependencies = copy.copy(new_target_dicts[t].get(deptype, []))
116117
new_dependencies = []

tools/gyp/pylib/gyp/MSVSVersion.py

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,17 +68,19 @@ def DefaultToolset(self):
6868
of a user override."""
6969
return self.default_toolset
7070

71-
def SetupScript(self, target_arch):
71+
def _SetupScriptInternal(self, target_arch):
7272
"""Returns a command (with arguments) to be used to set up the
7373
environment."""
74-
# Check if we are running in the SDK command line environment and use
75-
# the setup script from the SDK if so. |target_arch| should be either
76-
# 'x86' or 'x64'.
74+
# If WindowsSDKDir is set and SetEnv.Cmd exists then we are using the
75+
# depot_tools build tools and should run SetEnv.Cmd to set up the
76+
# environment. The check for WindowsSDKDir alone is not sufficient because
77+
# this is set by running vcvarsall.bat.
7778
assert target_arch in ('x86', 'x64')
7879
sdk_dir = os.environ.get('WindowsSDKDir')
79-
if self.sdk_based and sdk_dir:
80-
return [os.path.normpath(os.path.join(sdk_dir, 'Bin/SetEnv.Cmd')),
81-
'/' + target_arch]
80+
if sdk_dir:
81+
setup_path = os.path.normpath(os.path.join(sdk_dir, 'Bin/SetEnv.Cmd'))
82+
if self.sdk_based and sdk_dir and os.path.exists(setup_path):
83+
return [setup_path, '/' + target_arch]
8284
else:
8385
# We don't use VC/vcvarsall.bat for x86 because vcvarsall calls
8486
# vcvars32, which it can only find if VS??COMNTOOLS is set, which it
@@ -106,6 +108,14 @@ def SetupScript(self, target_arch):
106108
return [os.path.normpath(
107109
os.path.join(self.path, 'VC/vcvarsall.bat')), arg]
108110

111+
def SetupScript(self, target_arch):
112+
script_data = self._SetupScriptInternal(target_arch)
113+
script_path = script_data[0]
114+
if not os.path.exists(script_path):
115+
raise Exception('%s is missing - make sure VC++ tools are installed.' %
116+
script_path)
117+
return script_data
118+
109119

110120
def _RegistryQueryBase(sysdir, key, value):
111121
"""Use reg.exe to read a particular key.

tools/gyp/pylib/gyp/common.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,13 +425,15 @@ def GetFlavor(params):
425425
return 'freebsd'
426426
if sys.platform.startswith('openbsd'):
427427
return 'openbsd'
428+
if sys.platform.startswith('netbsd'):
429+
return 'netbsd'
428430
if sys.platform.startswith('aix'):
429431
return 'aix'
430432

431433
return 'linux'
432434

433435

434-
def CopyTool(flavor, out_path):
436+
def CopyTool(flavor, out_path, generator_flags={}):
435437
"""Finds (flock|mac|win)_tool.gyp in the gyp directory and copies it
436438
to |out_path|."""
437439
# aix and solaris just need flock emulation. mac and win use more complicated
@@ -451,11 +453,18 @@ def CopyTool(flavor, out_path):
451453
with open(source_path) as source_file:
452454
source = source_file.readlines()
453455

456+
# Set custom header flags.
457+
header = '# Generated by gyp. Do not edit.\n'
458+
mac_toolchain_dir = generator_flags.get('mac_toolchain_dir', None)
459+
if flavor == 'mac' and mac_toolchain_dir:
460+
header += "import os;\nos.environ['DEVELOPER_DIR']='%s'\n" \
461+
% mac_toolchain_dir
462+
454463
# Add header and write it out.
455464
tool_path = os.path.join(out_path, 'gyp-%s-tool' % prefix)
456465
with open(tool_path, 'w') as tool_file:
457466
tool_file.write(
458-
''.join([source[0], '# Generated by gyp. Do not edit.\n'] + source[1:]))
467+
''.join([source[0], header] + source[1:]))
459468

460469
# Make file executable.
461470
os.chmod(tool_path, 0755)

0 commit comments

Comments
 (0)