diff options
author | Eli Schwartz <eschwartz@archlinux.org> | 2022-03-27 11:46:42 -0400 |
---|---|---|
committer | Eli Schwartz <eschwartz@archlinux.org> | 2022-03-31 22:52:31 -0400 |
commit | 8ae2bf5a9e652d49027191709cda5353446af487 (patch) | |
tree | 930e6765fd6779e515221830d9167649092a7f90 /mesonbuild/build.py | |
parent | 3455f21f72fdc66f35479e01cf9d1fff50665c16 (diff) | |
download | meson-8ae2bf5a9e652d49027191709cda5353446af487.zip meson-8ae2bf5a9e652d49027191709cda5353446af487.tar.gz meson-8ae2bf5a9e652d49027191709cda5353446af487.tar.bz2 |
allow RunTarget to skip wrapping due to env
Forcing serialization on when writing out the build rule makes very
little sense. It was always "forced" on because we mandated a couple of
environment variables due to legacy reasons.
Add an attribute to RunTarget to say that a given target doesn't *need*
those environment variables, and let ninja optimize them away and run
the command directly if set.
Diffstat (limited to 'mesonbuild/build.py')
-rw-r--r-- | mesonbuild/build.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py index eaf9433..22927f9 100644 --- a/mesonbuild/build.py +++ b/mesonbuild/build.py @@ -2596,7 +2596,8 @@ class RunTarget(Target, CommandBase): subdir: str, subproject: str, environment: environment.Environment, - env: T.Optional['EnvironmentVariables'] = None): + env: T.Optional['EnvironmentVariables'] = None, + default_env: bool = True): self.typename = 'run' # These don't produce output artifacts super().__init__(name, subdir, subproject, False, MachineChoice.BUILD, environment) @@ -2605,6 +2606,7 @@ class RunTarget(Target, CommandBase): self.command = self.flatten_command(command) self.absolute_paths = False self.env = env + self.default_env = default_env def __repr__(self) -> str: repr_str = "<{0} {1}: {2}>" |