From c3c30d4b060239654c9b848092692ab346ebed9d Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Tue, 10 Aug 2021 20:07:39 -0700 Subject: 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 --- mesonbuild/modules/pkgconfig.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'mesonbuild/modules/pkgconfig.py') diff --git a/mesonbuild/modules/pkgconfig.py b/mesonbuild/modules/pkgconfig.py index 7be479667..c9bec4ab1 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.') -- cgit v1.2.3