diff options
Diffstat (limited to 'mesonbuild/build.py')
-rw-r--r-- | mesonbuild/build.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py index 41e21e3..e46b65f 100644 --- a/mesonbuild/build.py +++ b/mesonbuild/build.py @@ -47,6 +47,7 @@ known_basic_kwargs = {'install': True, 'objects': True, 'native': True, 'build_by_default': True, + 'override_options': True, } # These contain kwargs supported by both static and shared libraries. These are @@ -305,6 +306,7 @@ class BuildTarget(Target): self.extra_args = {} self.generated = [] self.extra_files = [] + self.option_overrides = {} # Sources can be: # 1. Pre-existing source files in the source tree # 2. Pre-existing sources generated by configure_file in the build tree @@ -670,6 +672,14 @@ class BuildTarget(Target): self.pic = kwargs.get('pic', False) if not isinstance(self.pic, bool): raise InvalidArguments('Argument pic to static library {!r} must be boolean'.format(self.name)) + overrides = stringlistify(kwargs.get('override_options', [])) + for o in overrides: + if '=' not in o: + raise InvalidArguments('Overrides must be of form "key=value"') + k, v = o.split('=', 1) + k = k.strip() + v = v.strip() + self.option_overrides[k] = v def get_filename(self): return self.filename |