diff options
author | Luca Boccassi <luca.boccassi@gmail.com> | 2018-09-30 13:53:12 +0100 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2019-01-17 20:40:19 +0200 |
commit | 267792174c9921e6be296086b0c806a684432a1b (patch) | |
tree | ef988cffbf23a750e71121ac9fa167f17c067273 /mesonbuild/build.py | |
parent | dbe2a296378d93b55c93c2406744ff3de13af6f5 (diff) | |
download | meson-267792174c9921e6be296086b0c806a684432a1b.zip meson-267792174c9921e6be296086b0c806a684432a1b.tar.gz meson-267792174c9921e6be296086b0c806a684432a1b.tar.bz2 |
custom_target: do not let install override build_by_default
A custom_target, if install is set to true, will always be built by
default even if build_by_default is explicitly set to false.
Ensure that this does not happen if it's set explicitly. To keep
backward compatibility, if build_by_default is not set explicitly and
install is true, set build_by_default to true.
Fixes #4107
Diffstat (limited to 'mesonbuild/build.py')
-rw-r--r-- | mesonbuild/build.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py index 52af562..d20b576 100644 --- a/mesonbuild/build.py +++ b/mesonbuild/build.py @@ -408,6 +408,11 @@ a hard error in the future.''' % name) self.build_by_default = kwargs['build_by_default'] if not isinstance(self.build_by_default, bool): raise InvalidArguments('build_by_default must be a boolean value.') + elif kwargs.get('install', False): + # For backward compatibility, if build_by_default is not explicitly + # set, use the value of 'install' if it's enabled. + self.build_by_default = True + self.option_overrides = self.parse_overrides(kwargs) def parse_overrides(self, kwargs): |