Commit a34f9bed authored by brettw@chromium.org's avatar brettw@chromium.org

Convert GN hyphens to underscores when passing command line args.

Some GYP variables are named like "pkg-config"

Replace - with _ when doing converting GN variable names.

TBR=michaeln

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238494 0039d316-1c4b-4281-b951-d872f2087c98
parent eb4a7974
......@@ -79,12 +79,14 @@ def GetVarsStringForGN(supplemental_files):
items = shlex.split(env_string)
for item in items:
tokens = item.split('=', 1)
# Some GYP variables have hyphens, which we don't support.
key = tokens[0].replace("-", "_")
if len(tokens) == 2:
# Escape $ characters which have special meaning to GN.
vars_dict[tokens[0]] = '"' + tokens[1].replace("$", "\\$") + '"'
vars_dict[key] = '"' + tokens[1].replace("$", "\\$") + '"'
else:
# No value supplied, treat it as a boolean and set it.
vars_dict[tokens[0]] = 'true'
vars_dict[key] = 'true'
vars_string = ''
for v in vars_dict:
......
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