Commit 791d0d35 authored by skyostil's avatar skyostil Committed by Commit bot

cr: Pass absolute path to output directory to gn

This ensures 'cr prepare' does the right thing even if run in a subdirectory of
src/.

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

Cr-Commit-Position: refs/heads/master@{#327265}
parent 6d60180f
...@@ -55,9 +55,8 @@ class GnPrepareOut(cr.PrepareOut): ...@@ -55,9 +55,8 @@ class GnPrepareOut(cr.PrepareOut):
if cr.context.verbose >= 1: if cr.context.verbose >= 1:
print cr.context.Substitute('Invoking gn with {GN_ARGS}') print cr.context.Substitute('Invoking gn with {GN_ARGS}')
args_file = os.path.join(cr.context['CR_SRC'], out_path = os.path.join(cr.context['CR_SRC'], cr.context['CR_OUT_FULL'])
cr.context['CR_OUT_FULL'], args_file = os.path.join(out_path, 'args.gn')
'args.gn')
args = {} args = {}
# Split the argument list while preserving quotes, # Split the argument list while preserving quotes,
# e.g., a="b c" becomes ('a', '"b c"'). # e.g., a="b c" becomes ('a', '"b c"').
...@@ -82,8 +81,4 @@ class GnPrepareOut(cr.PrepareOut): ...@@ -82,8 +81,4 @@ class GnPrepareOut(cr.PrepareOut):
with open(args_file, 'w') as f: with open(args_file, 'w') as f:
f.write('\n'.join(arg_lines) + '\n') f.write('\n'.join(arg_lines) + '\n')
cr.Host.Execute( cr.Host.Execute('gn', 'gen', out_path)
'gn',
'gen',
'{CR_OUT_FULL}',
)
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