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

Unified Diff: infra/bots/recipe_modules/flavor/gn_flavor.py

Issue 2324573002: GN: do not set default GN args (Closed)
Patch Set: is_debug too Created 4 years, 3 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 | « no previous file | infra/bots/recipes/swarm_compile.expected/Build-Mac-Clang-x86_64-Release-GN.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: infra/bots/recipe_modules/flavor/gn_flavor.py
diff --git a/infra/bots/recipe_modules/flavor/gn_flavor.py b/infra/bots/recipe_modules/flavor/gn_flavor.py
index 18a03e1a6e440e8e312e66c4ebb063fb315ef231..3154ef3425acc738fbabd11b00de3bc5029ea3fc 100644
--- a/infra/bots/recipe_modules/flavor/gn_flavor.py
+++ b/infra/bots/recipe_modules/flavor/gn_flavor.py
@@ -27,7 +27,7 @@ class GNFlavorUtils(default_flavor.DefaultFlavorUtils):
extra_config = self.m.vars.builder_cfg.get('extra_config', '')
os = self.m.vars.builder_cfg.get('os', '')
- cc, cxx = 'cc', 'c++'
+ cc, cxx = None, None
extra_cflags = []
extra_ldflags = []
@@ -45,14 +45,21 @@ class GNFlavorUtils(default_flavor.DefaultFlavorUtils):
if extra_config.startswith('SK'):
extra_cflags.append('-D' + extra_config)
- quote = lambda x: '"%s"' % x
- gn_args = ' '.join('%s=%s' % (k,v) for (k,v) in sorted({
- 'cc': quote(cc),
- 'cxx': quote(cxx),
- 'extra_cflags': quote(' '.join(extra_cflags)),
- 'extra_ldflags': quote(' '.join(extra_ldflags)),
- 'is_debug': 'true' if configuration == 'Debug' else 'false',
- }.iteritems()))
+ args = {}
+
+ if configuration != 'Debug':
+ args['is_debug'] = 'false'
+
+ for (k,v) in {
+ 'cc': cc,
+ 'cxx': cxx,
+ 'extra_cflags': ' '.join(extra_cflags),
+ 'extra_ldflags': ' '.join(extra_ldflags),
+ }.iteritems():
+ if v:
+ args[k] = '"%s"' % v
+
+ gn_args = ' '.join('%s=%s' % (k,v) for (k,v) in sorted(args.iteritems()))
self._run('fetch-gn', [self.m.vars.skia_dir.join('bin', 'fetch-gn')])
self._run('gn gen', ['gn', 'gen', self.out_dir, '--args=' + gn_args])
« no previous file with comments | « no previous file | infra/bots/recipes/swarm_compile.expected/Build-Mac-Clang-x86_64-Release-GN.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698