diff --git a/.gitignore b/.gitignore index 8a12a3dbfe..f944a5b197 100644 --- a/.gitignore +++ b/.gitignore @@ -85,6 +85,7 @@ /tools/android /tools/android-dummy-test /tools/clang +/tools/find_depot_tools /tools/gn /tools/grit /tools/gritsettings diff --git a/DEPS b/DEPS index 7312ee530a..cd535b47b9 100644 --- a/DEPS +++ b/DEPS @@ -11,7 +11,7 @@ vars = { "googlecode_url": "http://%s.googlecode.com/svn", "sourceforge_url": "http://svn.code.sf.net/p/%(repo)s/code", "chromium_trunk" : "http://src.chromium.org/svn/trunk", - "chromium_revision": "249215", + "chromium_revision": "255773", # A small subset of WebKit is needed for the Android Python test framework. "webkit_trunk": "http://src.chromium.org/blink/trunk", @@ -152,6 +152,9 @@ deps_os = { # SyzyASan to make it possible to run tests under ASan on Windows. "third_party/syzygy/binaries": From("chromium_deps", "src/third_party/syzygy/binaries"), + + "tools/find_depot_tools": + File(Var("chromium_trunk") + "/src/tools/find_depot_tools.py@" + Var("chromium_revision")), }, "mac": { @@ -307,6 +310,7 @@ hooks = [ }, { # A change to a .gyp, .gypi, or to GYP itself should run the generator. + "name": "gyp", "pattern": ".", "action": ["python", Var("root_dir") + "/webrtc/build/gyp_webrtc", Var("extra_gyp_flag")], diff --git a/webrtc/build/find_depot_tools.py b/webrtc/build/find_depot_tools.py deleted file mode 100644 index cfea09b70b..0000000000 --- a/webrtc/build/find_depot_tools.py +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env python -# -# Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. -# -# Use of this source code is governed by a BSD-style license -# that can be found in the LICENSE file in the root of the source -# tree. An additional intellectual property rights grant can be found -# in the file PATENTS. All contributing project authors may -# be found in the AUTHORS file in the root of the source tree. - -# This empty Python module is needed to avoid an error when importing -# gyp_chromium in gyp_webrtc. The reason we're doing that is to avoid code -# duplication. We don't use the functions that actually use the find_depot_tools -# module. It was introduced as a dependency in http://crrev.com/245412. diff --git a/webrtc/build/gyp_webrtc b/webrtc/build/gyp_webrtc index 8909eea811..9949e95d45 100755 --- a/webrtc/build/gyp_webrtc +++ b/webrtc/build/gyp_webrtc @@ -18,9 +18,9 @@ import sys script_dir = os.path.dirname(os.path.realpath(__file__)) checkout_root = os.path.abspath(os.path.join(script_dir, os.pardir, os.pardir)) -chrome_build_dir = os.path.join(checkout_root, 'build') -sys.path.insert(0, chrome_build_dir) +sys.path.insert(0, os.path.join(checkout_root, 'build')) +sys.path.insert(0, os.path.join(checkout_root, 'tools', 'find_depot_tools')) import gyp_chromium import gyp_helper @@ -60,11 +60,34 @@ if __name__ == '__main__': if not os.environ.get('GYP_GENERATORS'): os.environ['GYP_GENERATORS'] = 'ninja' + # Set default Visual Studio version to 2010 until WebRTC fully supports 2013. + # TODO(kjellander): Remove this to enable 2013 as default when we're ready. + if (sys.platform in ('cygwin', 'win32') and + not os.environ.get('GYP_MSVS_VERSION')): + print 'Setting GYP_MSVS_VERSION to 2010 by default.' + os.environ['GYP_MSVS_VERSION'] = '2010' + + vs2013_runtime_dll_dirs = None + if int(os.environ.get('GYP_MSVS_VERSION', '2010')) == 2013: + # Download Chromium's stripped down Visual Studio 2013 compile toolchain. + # TODO(kjellander): Make this look like gyp_chromium when 2013 works for us, + # this can currently only run for 2013 since GYP_MSVS_VERSION gets + # overwritten with 2013 in DownloadVsToolChain() right now. + vs2013_runtime_dll_dirs = gyp_chromium.DownloadVsToolChain() + # Enforce gyp syntax checking. This adds about 20% execution time. args.append('--check') supplemental_includes = gyp_chromium.GetSupplementalFiles() - if not gyp_chromium.RunGN(supplemental_includes): + gn_vars_dict = gyp_chromium.GetGypVarsForGN(supplemental_includes) + + # Automatically turn on crosscompile support for platforms that need it. + if all(('ninja' in os.environ.get('GYP_GENERATORS', ''), + gn_vars_dict.get('OS') in ['android', 'ios'], + 'GYP_CROSSCOMPILE' not in os.environ)): + os.environ['GYP_CROSSCOMPILE'] = '1' + + if not gyp_chromium.RunGN(gn_vars_dict): sys.exit(1) args.extend(['-I' + i for i in gyp_chromium.additional_include_files(supplemental_includes, @@ -77,4 +100,12 @@ if __name__ == '__main__': sys.stdout.flush() # Off we go... - sys.exit(gyp.main(args)) + gyp_rc = gyp.main(args) + + if vs2013_runtime_dll_dirs: + x64_runtime, x86_runtime = vs2013_runtime_dll_dirs + gyp_chromium.CopyVsRuntimeDlls( + os.path.join(checkout_root, gyp_chromium.GetOutputDirectory()), + (x86_runtime, x64_runtime)) + + sys.exit(gyp_rc)