Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions tools/gyp/AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ Steven Knight <knight@baldmt.com>
Ryan Norton <rnorton10@gmail.com>
David J. Sankel <david@sankelsoftware.com>
Eric N. Vander Weele <ericvw@gmail.com>
Tom Freudenberg <th.freudenberg@gmail.com>
Julien Brianceau <jbriance@cisco.com>
9 changes: 4 additions & 5 deletions tools/gyp/DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
# (You don't need to use gclient for normal GYP development work.)

vars = {
"chrome_trunk": "http://src.chromium.org/svn/trunk",
"googlecode_url": "http://%s.googlecode.com/svn",
"chromium_git": "https://chromium.googlesource.com/",
}

deps = {
Expand All @@ -13,12 +12,12 @@ deps = {
deps_os = {
"win": {
"third_party/cygwin":
Var("chrome_trunk") + "/deps/third_party/cygwin@66844",
Var("chromium_git") + "chromium/deps/cygwin@4fbd5b9",

"third_party/python_26":
Var("chrome_trunk") + "/tools/third_party/python_26@89111",
Var("chromium_git") + "chromium/deps/python_26@5bb4080",

"src/third_party/pefile":
(Var("googlecode_url") % "pefile") + "/trunk@63",
Var("chromium_git") + "external/pefile@72c6ae4",
},
}
4 changes: 4 additions & 0 deletions tools/gyp/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
GYP can Generate Your Projects.
===================================

Documents are available at [gyp.gsrc.io](https://gyp.gsrc.io), or you can check out ```md-pages``` branch to read those documents offline.
1 change: 1 addition & 0 deletions tools/gyp/pylib/gyp/MSVSSettings.py
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,7 @@ def _ValidateSettings(validators, settings, stderr):
_Same(_compile, 'UseFullPaths', _boolean) # /FC
_Same(_compile, 'WholeProgramOptimization', _boolean) # /GL
_Same(_compile, 'XMLDocumentationFileName', _file_name)
_Same(_compile, 'CompileAsWinRT', _boolean) # /ZW

_Same(_compile, 'AssemblerOutput',
_Enumeration(['NoListing',
Expand Down
3 changes: 2 additions & 1 deletion tools/gyp/pylib/gyp/MSVSUtil.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
'loadable_module': 'dll',
'shared_library': 'dll',
'static_library': 'lib',
'windows_driver': 'sys',
}


Expand Down Expand Up @@ -110,7 +111,7 @@ def ShardTargets(target_list, target_dicts):
else:
new_target_dicts[t] = target_dicts[t]
# Shard dependencies.
for t in new_target_dicts:
for t in sorted(new_target_dicts):
for deptype in ('dependencies', 'dependencies_original'):
dependencies = copy.copy(new_target_dicts[t].get(deptype, []))
new_dependencies = []
Expand Down
24 changes: 17 additions & 7 deletions tools/gyp/pylib/gyp/MSVSVersion.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,19 @@ def DefaultToolset(self):
of a user override."""
return self.default_toolset

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

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


def _RegistryQueryBase(sysdir, key, value):
"""Use reg.exe to read a particular key.
Expand Down
13 changes: 11 additions & 2 deletions tools/gyp/pylib/gyp/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,13 +425,15 @@ def GetFlavor(params):
return 'freebsd'
if sys.platform.startswith('openbsd'):
return 'openbsd'
if sys.platform.startswith('netbsd'):
return 'netbsd'
if sys.platform.startswith('aix'):
return 'aix'

return 'linux'


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

# Set custom header flags.
header = '# Generated by gyp. Do not edit.\n'
mac_toolchain_dir = generator_flags.get('mac_toolchain_dir', None)
if flavor == 'mac' and mac_toolchain_dir:
header += "import os;\nos.environ['DEVELOPER_DIR']='%s'\n" \
% mac_toolchain_dir

# Add header and write it out.
tool_path = os.path.join(out_path, 'gyp-%s-tool' % prefix)
with open(tool_path, 'w') as tool_file:
tool_file.write(
''.join([source[0], '# Generated by gyp. Do not edit.\n'] + source[1:]))
''.join([source[0], header] + source[1:]))

# Make file executable.
os.chmod(tool_path, 0755)
Expand Down
Loading