diff options
author | Xavier Claessens <xavier.claessens@collabora.com> | 2023-08-25 13:08:17 -0400 |
---|---|---|
committer | Xavier Claessens <xclaesse@gmail.com> | 2023-08-28 20:18:26 -0400 |
commit | 4eb9c84cf97427a11af7ec928c849e4289862202 (patch) | |
tree | 3c0c62460895deb1ece544a77e8e1bf92b45e8de /mesonbuild | |
parent | 83d3bf85cf0d34a73bffc3c79f758f4ff3b13fbd (diff) | |
download | meson-4eb9c84cf97427a11af7ec928c849e4289862202.zip meson-4eb9c84cf97427a11af7ec928c849e4289862202.tar.gz meson-4eb9c84cf97427a11af7ec928c849e4289862202.tar.bz2 |
include_directories: Always add both source and build dirs
Compiler checks were not adding build dir side, which prevents using
headers generated with configure_file().
Diffstat (limited to 'mesonbuild')
-rw-r--r-- | mesonbuild/build.py | 5 | ||||
-rw-r--r-- | mesonbuild/interpreter/compiler.py | 2 | ||||
-rw-r--r-- | mesonbuild/mintro.py | 2 |
3 files changed, 4 insertions, 5 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py index d064fff..8fed785 100644 --- a/mesonbuild/build.py +++ b/mesonbuild/build.py @@ -389,7 +389,7 @@ class IncludeDirs(HoldableObject): def get_extra_build_dirs(self) -> T.List[str]: return self.extra_build_dirs - def to_string_list(self, sourcedir: str, builddir: T.Optional[str] = None) -> T.List[str]: + def to_string_list(self, sourcedir: str, builddir: str) -> T.List[str]: """Convert IncludeDirs object to a list of strings. :param sourcedir: The absolute source directory @@ -400,8 +400,7 @@ class IncludeDirs(HoldableObject): strlist: T.List[str] = [] for idir in self.incdirs: strlist.append(os.path.join(sourcedir, self.curdir, idir)) - if builddir: - strlist.append(os.path.join(builddir, self.curdir, idir)) + strlist.append(os.path.join(builddir, self.curdir, idir)) return strlist @dataclass(eq=False) diff --git a/mesonbuild/interpreter/compiler.py b/mesonbuild/interpreter/compiler.py index 0e34f6c..b85aa37 100644 --- a/mesonbuild/interpreter/compiler.py +++ b/mesonbuild/interpreter/compiler.py @@ -257,7 +257,7 @@ class CompilerHolder(ObjectHolder['Compiler']): mode: CompileCheckMode = CompileCheckMode.LINK) -> T.List[str]: args: T.List[str] = [] for i in kwargs['include_directories']: - for idir in i.to_string_list(self.environment.get_source_dir()): + for idir in i.to_string_list(self.environment.get_source_dir(), self.environment.get_build_dir()): args.extend(self.compiler.get_include_args(idir, False)) if not kwargs['no_builtin_args']: opts = self.environment.coredata.options diff --git a/mesonbuild/mintro.py b/mesonbuild/mintro.py index ab31ec9..0391535 100644 --- a/mesonbuild/mintro.py +++ b/mesonbuild/mintro.py @@ -412,7 +412,7 @@ def list_deps(coredata: cdata.CoreData, backend: backends.Backend) -> T.List[T.D 'version': d.get_version(), 'compile_args': d.get_compile_args(), 'link_args': d.get_link_args(), - 'include_directories': [i for idirs in d.get_include_dirs() for i in idirs.to_string_list(backend.source_dir)], + 'include_directories': [i for idirs in d.get_include_dirs() for i in idirs.to_string_list(backend.source_dir, backend.build_dir)], 'sources': [f for s in d.get_sources() for f in _src_to_str(s)], 'extra_files': [f for s in d.get_extra_files() for f in _src_to_str(s)], 'dependencies': [e.name for e in d.ext_deps], |