aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2021-06-14 15:36:16 -0700
committerDylan Baker <dylan@pnwbakers.com>2021-06-22 09:12:54 -0700
commitf2ad5e377e0c70f4c7292f6abb33cbaa283d84b2 (patch)
tree79b53a7e0653aba6d6e05842e3b5bc20dda9c179
parentbee4dc9f78ad6f6d81df34816d28c06520e972a1 (diff)
downloadmeson-f2ad5e377e0c70f4c7292f6abb33cbaa283d84b2.zip
meson-f2ad5e377e0c70f4c7292f6abb33cbaa283d84b2.tar.gz
meson-f2ad5e377e0c70f4c7292f6abb33cbaa283d84b2.tar.bz2
backend: Headers.install_subdir is allowed to be None
But we don't properly handle that.
-rw-r--r--mesonbuild/backend/backends.py7
-rw-r--r--mesonbuild/build.py2
2 files changed, 7 insertions, 2 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py
index 2652ae6..4e1ac1e 100644
--- a/mesonbuild/backend/backends.py
+++ b/mesonbuild/backend/backends.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')
diff --git a/mesonbuild/build.py b/mesonbuild/build.py
index 414a4f8..83dd3f0 100644
--- a/mesonbuild/build.py
+++ b/mesonbuild/build.py
@@ -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]: