diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2021-02-07 16:57:39 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-07 16:57:39 +0000 |
commit | a855bcab1ccaff68155374c53896c1a780337f40 (patch) | |
tree | 9f5da58d50d50e74bd0c3741420f72918f161863 /mesonbuild/build.py | |
parent | 3f8585676ba6d2c1bcd5d80a44275fdfa695f8c2 (diff) | |
parent | 9cebd29da973553c6e657f7b318ab1d6afbc76e6 (diff) | |
download | meson-a855bcab1ccaff68155374c53896c1a780337f40.zip meson-a855bcab1ccaff68155374c53896c1a780337f40.tar.gz meson-a855bcab1ccaff68155374c53896c1a780337f40.tar.bz2 |
Merge pull request #8162 from dcbaker/wip/2021-01/rust-module-bindgen
Add a wrapper to the rust module for bindgen
Diffstat (limited to 'mesonbuild/build.py')
-rw-r--r-- | mesonbuild/build.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py index 160ee9a..9a4f8b1 100644 --- a/mesonbuild/build.py +++ b/mesonbuild/build.py @@ -322,6 +322,13 @@ class IncludeDirs: def get_extra_build_dirs(self): return self.extra_build_dirs + def to_string_list(self, sourcedir: str) -> T.List[str]: + """Convert IncludeDirs object to a list of strings.""" + strlist: T.List[str] = [] + for idir in self.incdirs: + strlist.append(os.path.join(sourcedir, self.curdir, idir)) + return strlist + class ExtractedObjects: ''' Holds a list of sources for which the objects must be extracted @@ -2189,7 +2196,8 @@ class CustomTarget(Target, CommandBase): 'env', ]) - def __init__(self, name, subdir, subproject, kwargs, absolute_paths=False, backend=None): + def __init__(self, name: str, subdir: str, subproject: str, kwargs: T.Dict[str, T.Any], + absolute_paths: bool = False, backend: T.Optional[str] = None): self.typename = 'custom' # TODO expose keyword arg to make MachineChoice.HOST configurable super().__init__(name, subdir, subproject, False, MachineChoice.HOST) @@ -2204,7 +2212,7 @@ class CustomTarget(Target, CommandBase): for k in kwargs: if k not in CustomTarget.known_kwargs: unknowns.append(k) - if len(unknowns) > 0: + if unknowns: mlog.warning('Unknown keyword arguments in target {}: {}'.format(self.name, ', '.join(unknowns))) def get_default_install_dir(self, environment): |