From 67670abe3cdb1ec6284146be50496e227dfca449 Mon Sep 17 00:00:00 2001 From: Michael Spang Date: Fri, 29 Jul 2022 13:37:54 -0400 Subject: [PATCH] Always generate from build_examples.py (#21382) Currently changes to the arguments used when buildin examples are not reflected in incremental builds. This is a confusing situation when it occurs. Don't skip the generate step as this also sets the configuration. --- scripts/build/builders/gn.py | 43 ++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/scripts/build/builders/gn.py b/scripts/build/builders/gn.py index 1c00bf1c1e9d89..031546ae388873 100644 --- a/scripts/build/builders/gn.py +++ b/scripts/build/builders/gn.py @@ -54,33 +54,32 @@ def PostBuildCommand(self): pass def generate(self): - if not os.path.exists(self.output_dir): - cmd = [ - 'gn', 'gen', '--check', '--fail-on-unused-args', - '--export-compile-commands', - '--root=%s' % self.root - ] + cmd = [ + 'gn', 'gen', '--check', '--fail-on-unused-args', + '--export-compile-commands', + '--root=%s' % self.root + ] - extra_args = self.GnBuildArgs() - if extra_args: - cmd += ['--args=%s' % ' '.join(extra_args)] + extra_args = self.GnBuildArgs() + if extra_args: + cmd += ['--args=%s' % ' '.join(extra_args)] - cmd += [self.output_dir] + cmd += [self.output_dir] - title = 'Generating ' + self.identifier - extra_env = self.GnBuildEnv() + title = 'Generating ' + self.identifier + extra_env = self.GnBuildEnv() - if extra_env: - # convert the command into a bash command that includes - # setting environment variables - cmd = [ - 'bash', '-c', '\n' + ' '.join( - ['%s="%s" \\\n' % (key, value) for key, value in extra_env.items()] + - [shlex.join(cmd)] - ) - ] + if extra_env: + # convert the command into a bash command that includes + # setting environment variables + cmd = [ + 'bash', '-c', '\n' + ' '.join( + ['%s="%s" \\\n' % (key, value) for key, value in extra_env.items()] + + [shlex.join(cmd)] + ) + ] - self._Execute(cmd, title=title) + self._Execute(cmd, title=title) def _build(self): self.PreBuildCommand()