Commit 9e08eee5 authored by Garrett Beaty's avatar Garrett Beaty Committed by Commit Bot

Remove dead code dealing with gyp.

Bug: 889992
Change-Id: I3cc9b095ecd19acda49e1d1d34b5b064668d7e26
Reviewed-on: https://chromium-review.googlesource.com/c/1343367Reviewed-by: default avatarJohn Budorick <jbudorick@chromium.org>
Commit-Queue: Garrett Beaty <gbeaty@chromium.org>
Cr-Commit-Position: refs/heads/master@{#611908}
parent 3177145e
......@@ -4,11 +4,8 @@
"""This script is now only used by the closure_compilation builders."""
import argparse
import glob
import gyp_environment
import os
import shlex
import sys
script_dir = os.path.dirname(os.path.realpath(__file__))
......@@ -18,41 +15,6 @@ sys.path.insert(0, os.path.join(chrome_src, 'tools', 'gyp', 'pylib'))
import gyp
def ProcessGypDefinesItems(items):
"""Converts a list of strings to a list of key-value pairs."""
result = []
for item in items:
tokens = item.split('=', 1)
# Some GYP variables have hyphens, which we don't support.
if len(tokens) == 2:
result += [(tokens[0], tokens[1])]
else:
# No value supplied, treat it as a boolean and set it. Note that we
# use the string '1' here so we have a consistent definition whether
# you do 'foo=1' or 'foo'.
result += [(tokens[0], '1')]
return result
def GetSupplementalFiles():
return []
def GetGypVars(_):
"""Returns a dictionary of all GYP vars."""
# GYP defines from the environment.
env_items = ProcessGypDefinesItems(
shlex.split(os.environ.get('GYP_DEFINES', '')))
# GYP defines from the command line.
parser = argparse.ArgumentParser()
parser.add_argument('-D', dest='defines', action='append', default=[])
cmdline_input_items = parser.parse_known_args()[0].defines
cmdline_items = ProcessGypDefinesItems(cmdline_input_items)
return dict(env_items + cmdline_items)
def main():
gyp_environment.SetEnvironment()
......
......@@ -8,15 +8,12 @@ gyp_chromium and landmines.py which run at different stages of runhooks. To
make sure settings are consistent between them, all setup should happen here.
"""
import gyp_helper
import os
import sys
import vs_toolchain
def SetEnvironment():
"""Sets defaults for GYP_* variables."""
gyp_helper.apply_chromium_gyp_env()
# Default to ninja on linux and windows, but only if no generator has
# explicitly been set.
# Also default to ninja on mac, but only when not building chrome/ios.
......
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This file helps gyp_chromium and landmines correctly set up the gyp
# environment from chromium.gyp_env on disk
import os
SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
CHROME_SRC = os.path.dirname(SCRIPT_DIR)
def apply_gyp_environment_from_file(file_path):
"""Reads in a *.gyp_env file and applies the valid keys to os.environ."""
if not os.path.exists(file_path):
return
with open(file_path, 'rU') as f:
file_contents = f.read()
try:
file_data = eval(file_contents, {'__builtins__': None}, None)
except SyntaxError, e:
e.filename = os.path.abspath(file_path)
raise
supported_vars = (
'CC',
'CC_wrapper',
'CC.host_wrapper',
'CHROMIUM_GYP_FILE',
'CHROMIUM_GYP_SYNTAX_CHECK',
'CXX',
'CXX_wrapper',
'CXX.host_wrapper',
'GYP_DEFINES',
'GYP_GENERATOR_FLAGS',
'GYP_CROSSCOMPILE',
'GYP_GENERATOR_OUTPUT',
'GYP_GENERATORS',
'GYP_INCLUDE_FIRST',
'GYP_INCLUDE_LAST',
'GYP_MSVS_VERSION',
)
for var in supported_vars:
file_val = file_data.get(var)
if file_val:
if var in os.environ:
behavior = 'replaces'
if var == 'GYP_DEFINES':
result = file_val + ' ' + os.environ[var]
behavior = 'merges with, and individual components override,'
else:
result = os.environ[var]
print 'INFO: Environment value for "%s" %s value in %s' % (
var, behavior, os.path.abspath(file_path)
)
string_padding = max(len(var), len(file_path), len('result'))
print ' %s: %s' % (var.rjust(string_padding), os.environ[var])
print ' %s: %s' % (file_path.rjust(string_padding), file_val)
os.environ[var] = result
else:
os.environ[var] = file_val
def apply_chromium_gyp_env():
if 'SKIP_CHROMIUM_GYP_ENV' not in os.environ:
# Update the environment based on chromium.gyp_env
path = os.path.join(os.path.dirname(CHROME_SRC), 'chromium.gyp_env')
apply_gyp_environment_from_file(path)
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