Skip to content

Commit

Permalink
Always generate from build_examples.py (#21382)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mspang authored and pull[bot] committed Nov 14, 2023
1 parent a3aa5a1 commit 2619781
Showing 1 changed file with 21 additions and 22 deletions.
43 changes: 21 additions & 22 deletions scripts/build/builders/gn.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 2619781

Please sign in to comment.