From f39ccde5138aeabcbd483ca4b779954f056324e2 Mon Sep 17 00:00:00 2001 From: Daniele Nicolodi Date: Tue, 21 Feb 2023 20:45:12 +0100 Subject: mintro: Add exclude_{files, dirs} to install_subdir install_plan These are necessary for projects outside Meson itself that want to extend the 'meson install' functionality as meson-python does to assemble Python package wheels from Meson projects. Fixes #11426. --- mesonbuild/mintro.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'mesonbuild/mintro.py') diff --git a/mesonbuild/mintro.py b/mesonbuild/mintro.py index 231267471..1fd0f3d1e 100644 --- a/mesonbuild/mintro.py +++ b/mesonbuild/mintro.py @@ -146,11 +146,19 @@ def list_install_plan(installdata: backends.InstallData) -> T.Dict[str, T.Dict[s if key == 'headers': # in the headers, install_path_name is the directory install_path_name = os.path.join(install_path_name, os.path.basename(data.path)) - plan[data_type] = plan.get(data_type, {}) - plan[data_type][data.path] = { + entry = { 'destination': install_path_name, 'tag': data.tag or None, } + + if key == 'install_subdirs': + exclude_files, exclude_dirs = data.exclude or ([], []) + entry['exclude_dirs'] = list(exclude_dirs) + entry['exclude_files'] = list(exclude_files) + + plan[data_type] = plan.get(data_type, {}) + plan[data_type][data.path] = entry + return plan def get_target_dir(coredata: cdata.CoreData, subdir: str) -> str: -- cgit v1.2.3