Commit 52276b36 authored by machenbach's avatar machenbach Committed by Commit bot

Use msvs toolchain from depot_tools.

This ports some code from chromium for using the bundled
toolchain.

BUG=chromium:548586
LOG=n

Review URL: https://codereview.chromium.org/1237803003

Cr-Commit-Position: refs/heads/master@{#31706}
parent 0c224551
......@@ -43,6 +43,7 @@ shell_g
/build/gyp
/build/ipch/
/build/Release
/build/win_toolchain.json
/buildtools
/hydrogen.cfg
/obj
......
......@@ -134,6 +134,12 @@ hooks = [
'-d', 'v8/tools/luci-go/linux64',
],
},
{
# Update the Windows toolchain if necessary.
'name': 'win_toolchain',
'pattern': '.',
'action': ['python', 'v8/build/vs_toolchain.py', 'update'],
},
# Pull binutils for linux, enabled debug fission for faster linking /
# debugging when used with clang on Ubuntu Precise.
# https://code.google.com/p/chromium/issues/detail?id=352046
......
......@@ -24,6 +24,7 @@ def main():
print 'Moar clobbering...'
print 'Remove build/android.gypi'
print 'Cleanup after windows ninja switch attempt.'
print 'Switching to pinned msvs toolchain.'
return 0
......
......@@ -10,6 +10,7 @@ make sure settings are consistent between them, all setup should happen here.
import os
import sys
import vs_toolchain
SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
V8_ROOT = os.path.abspath(os.path.join(SCRIPT_DIR, os.pardir))
......@@ -50,3 +51,4 @@ def set_environment():
# Update the environment based on v8.gyp_env
gyp_env_path = os.path.join(os.path.dirname(V8_ROOT), 'v8.gyp_env')
apply_gyp_environment(gyp_env_path)
vs_toolchain.SetEnvironmentAndGetRuntimeDllDirs()
......@@ -30,6 +30,7 @@
# This script is wrapper for V8 that adds some support for how GYP
# is invoked by V8 beyond what can be done in the gclient hooks.
import argparse
import glob
import gyp_environment
import os
......@@ -37,6 +38,7 @@ import platform
import shlex
import subprocess
import sys
import vs_toolchain
script_dir = os.path.dirname(os.path.realpath(__file__))
v8_root = os.path.abspath(os.path.join(script_dir, os.pardir))
......@@ -49,6 +51,25 @@ sys.path.insert(
1, os.path.abspath(os.path.join(v8_root, 'tools', 'generate_shim_headers')))
def GetOutputDirectory():
"""Returns the output directory that GYP will use."""
# Handle command line generator flags.
parser = argparse.ArgumentParser()
parser.add_argument('-G', dest='genflags', default=[], action='append')
genflags = parser.parse_known_args()[0].genflags
# Handle generator flags from the environment.
genflags += shlex.split(os.environ.get('GYP_GENERATOR_FLAGS', ''))
needle = 'output_dir='
for item in genflags:
if item.startswith(needle):
return item[len(needle):]
return 'out'
def additional_include_files(args=[]):
"""
Returns a list of additional (.gypi) files to include, without
......@@ -82,6 +103,13 @@ def additional_include_files(args=[]):
def run_gyp(args):
rc = gyp.main(args)
vs2013_runtime_dll_dirs = vs_toolchain.SetEnvironmentAndGetRuntimeDllDirs()
if vs2013_runtime_dll_dirs:
x64_runtime, x86_runtime = vs2013_runtime_dll_dirs
vs_toolchain.CopyVsRuntimeDlls(
os.path.join(v8_root, GetOutputDirectory()),
(x86_runtime, x64_runtime))
if rc != 0:
print 'Error running GYP'
sys.exit(rc)
......@@ -130,6 +158,7 @@ if __name__ == '__main__':
# Generate for the architectures supported on the given platform.
gyp_args = list(args)
gyp_args.extend(['-D', 'gyp_output_dir=' + GetOutputDirectory()])
gyp_generators = os.environ.get('GYP_GENERATORS', '')
if platform.system() == 'Linux' and gyp_generators != 'ninja':
# Work around for crbug.com/331475.
......
......@@ -97,6 +97,10 @@
'cfi_blacklist%': '<(base_dir)/tools/cfi/blacklist.txt',
# Set to 1 to enable fast builds.
# TODO(machenbach): Only configured for windows.
'fastbuild%': 0,
# goma settings.
# 1 to use goma.
# If no gomadir is set, it uses the default gomadir.
......@@ -155,6 +159,7 @@
'cfi_diag%': '<(cfi_diag)',
'cfi_blacklist%': '<(cfi_blacklist)',
'test_isolation_mode%': '<(test_isolation_mode)',
'fastbuild%': '<(fastbuild)',
# Add a simple extras solely for the purpose of the cctests
'v8_extra_library_files': ['../test/cctest/test-extra.js'],
......@@ -206,12 +211,8 @@
['OS=="win" and use_goma==1', {
# goma doesn't support pch yet.
'chromium_win_pch': 0,
# goma doesn't support PDB yet, so win_z7=1 or fastbuild=1.
'conditions': [
['win_z7==0 and fastbuild==0', {
'fastbuild': 1,
}],
],
# goma doesn't support PDB yet.
'fastbuild%': 1,
}],
['((v8_target_arch=="ia32" or v8_target_arch=="x64" or v8_target_arch=="x87") and \
(OS=="linux" or OS=="mac")) or (v8_target_arch=="ppc64" and OS=="linux")', {
......@@ -433,6 +434,23 @@
}],
],
}],
['fastbuild!=0', {
'conditions': [
['OS=="win" and fastbuild==1', {
'msvs_settings': {
'VCLinkerTool': {
# This tells the linker to generate .pdbs, so that
# we can get meaningful stack traces.
'GenerateDebugInformation': 'true',
},
'VCCLCompilerTool': {
# No debug info to be generated by compiler.
'DebugInformationFormat': '0',
},
},
}],
],
}], # fastbuild!=0
],
'target_conditions': [
['v8_code == 0', {
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment