aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/modules/pkgconfig.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2021-08-10 20:07:39 -0700
committerDaniel Mensinger <daniel@mensinger-ka.de>2021-09-30 21:01:38 +0200
commitc3c30d4b060239654c9b848092692ab346ebed9d (patch)
tree52b2ebd5e5c788fb529dac1717051093311ca255 /mesonbuild/modules/pkgconfig.py
parentbb706231bd3bfd8983f1a5df24111efe1ad0734d (diff)
downloadmeson-c3c30d4b060239654c9b848092692ab346ebed9d.zip
meson-c3c30d4b060239654c9b848092692ab346ebed9d.tar.gz
meson-c3c30d4b060239654c9b848092692ab346ebed9d.tar.bz2
interpreter: Use typed_kwargs for func_custom_target
This does not convert the build side, or remove any of the checking it does. We still need that for other callers of custom target. What we'll do for those is add an internal interface that defaults things, then we'll be able to have those callers do their own validation, and the CustomTarget validation machinary can be removed. Fixes #9096
Diffstat (limited to 'mesonbuild/modules/pkgconfig.py')
-rw-r--r--mesonbuild/modules/pkgconfig.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/mesonbuild/modules/pkgconfig.py b/mesonbuild/modules/pkgconfig.py
index 7be4796..c9bec4a 100644
--- a/mesonbuild/modules/pkgconfig.py
+++ b/mesonbuild/modules/pkgconfig.py
@@ -381,7 +381,8 @@ class PkgConfigModule(ExtensionModule):
if uninstalled:
install_dir = os.path.dirname(state.backend.get_target_filename_abs(l))
else:
- install_dir = l.get_custom_install_dir()[0]
+ _i = l.get_custom_install_dir()
+ install_dir = _i[0] if _i else None
if install_dir is False:
continue
is_custom_target = isinstance(l, (build.CustomTarget, build.CustomTargetIndex))
@@ -471,9 +472,9 @@ class PkgConfigModule(ExtensionModule):
raise mesonlib.MesonException('Pkgconfig_gen first positional argument must be a library object')
default_name = mainlib.name
default_description = state.project_name + ': ' + mainlib.name
- install_dir = mainlib.get_custom_install_dir()[0]
- if isinstance(install_dir, str):
- default_install_dir = os.path.join(install_dir, 'pkgconfig')
+ install_dir = mainlib.get_custom_install_dir()
+ if install_dir and isinstance(install_dir[0], str):
+ default_install_dir = os.path.join(install_dir[0], 'pkgconfig')
elif len(args) > 1:
raise mesonlib.MesonException('Too many positional arguments passed to Pkgconfig_gen.')