backend: Headers.install_subdir is allowed to be None

But we don't properly handle that.
pull/8884/head
Dylan Baker 3 years ago
parent bee4dc9f78
commit f2ad5e377e
  1. 7
      mesonbuild/backend/backends.py
  2. 2
      mesonbuild/build.py

@ -1445,7 +1445,12 @@ class Backend:
for h in headers:
outdir = h.get_custom_install_dir()
if outdir is None:
outdir = os.path.join(incroot, h.get_install_subdir())
subdir = h.get_install_subdir()
if subdir is None:
outdir = incroot
else:
outdir = os.path.join(incroot, subdir)
for f in h.get_sources():
if not isinstance(f, File):
raise MesonException(f'Invalid header type {f!r} can\'t be installed')

@ -149,7 +149,7 @@ class Headers(HoldableObject):
def set_install_subdir(self, subdir: str) -> None:
self.install_subdir = subdir
def get_install_subdir(self) -> str:
def get_install_subdir(self) -> T.Optional[str]:
return self.install_subdir
def get_sources(self) -> T.List[File]:

Loading…
Cancel
Save