From 5f624657a0238157e7786478335e25e3fe9c2ca0 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Wed, 6 Jan 2021 11:29:54 -0800 Subject: Add a method to IncludeDirs to convert to string list I'm going to use this in the rust module as well, so having a single source of truth is useful. --- mesonbuild/build.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'mesonbuild/build.py') diff --git a/mesonbuild/build.py b/mesonbuild/build.py index 36bce1c..8968b18 100644 --- a/mesonbuild/build.py +++ b/mesonbuild/build.py @@ -323,6 +323,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 -- cgit v1.1