Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Unified Diff: tools/cr/cr/commands/init.py

Issue 1095613002: cr: Add support for GN build file generation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nits addressed. Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/cr/cr/base/android.py ('k') | tools/cr/cr/commands/prepare.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/cr/cr/commands/init.py
diff --git a/tools/cr/cr/commands/init.py b/tools/cr/cr/commands/init.py
index 95652c7a0446a4d116e92d7735177e80170468fe..bf73a24c65116e27095b7b8267368a1efc4a4d43 100644
--- a/tools/cr/cr/commands/init.py
+++ b/tools/cr/cr/commands/init.py
@@ -11,8 +11,12 @@ import cr
# The set of variables to store in the per output configuration.
OUT_CONFIG_VARS = [
'CR_VERSION',
- cr.Platform.SELECTOR, cr.BuildType.SELECTOR, cr.Arch.SELECTOR,
- 'CR_OUT_BASE', 'CR_OUT_FULL',
+ cr.Platform.SELECTOR,
+ cr.BuildType.SELECTOR,
+ cr.Arch.SELECTOR,
+ cr.PrepareOut.SELECTOR,
+ 'CR_OUT_BASE',
+ 'CR_OUT_FULL',
]
@@ -43,6 +47,7 @@ class InitCommand(cr.Command):
cr.BuildType.AddArguments(parser)
cr.Arch.AddArguments(parser)
cr.SelectCommand.AddPrepareArguments(parser)
+ cr.PrepareOut.AddArguments(parser)
parser.add_argument(
'-s', '--set', dest='_settings', metavar='settings',
action='append',
@@ -85,11 +90,15 @@ class InitCommand(cr.Command):
print 'Matched all of', ','.join(matches)
exit(1)
platform = matches[0]
+ generator = cr.context.args.CR_GENERATOR
+ if not generator:
+ generator = 'gyp'
cr.context.derived.Set(
CR_OUT_FULL=out,
CR_OUT_BASE=base,
CR_PLATFORM=platform,
CR_BUILDTYPE=buildtype,
+ CR_GENERATOR=generator
)
if not 'CR_OUT_BASE' in cr.context:
cr.context.derived['CR_OUT_BASE'] = 'out_{CR_PLATFORM}'
« no previous file with comments | « tools/cr/cr/base/android.py ('k') | tools/cr/cr/commands/prepare.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698