diff options
author | Daniele Nicolodi <daniele@grinta.net> | 2023-02-21 20:45:12 +0100 |
---|---|---|
committer | Eli Schwartz <eschwartz93@gmail.com> | 2023-02-27 07:03:30 -0500 |
commit | f39ccde5138aeabcbd483ca4b779954f056324e2 (patch) | |
tree | ce244ca87dc2cb903e000c6d4d96a50023ac1fb7 /mesonbuild/mintro.py | |
parent | b80f8456ec754c579dfd5c1bbb4dc4be3500e7e6 (diff) | |
download | meson-f39ccde5138aeabcbd483ca4b779954f056324e2.zip meson-f39ccde5138aeabcbd483ca4b779954f056324e2.tar.gz meson-f39ccde5138aeabcbd483ca4b779954f056324e2.tar.bz2 |
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.
Diffstat (limited to 'mesonbuild/mintro.py')
-rw-r--r-- | mesonbuild/mintro.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/mesonbuild/mintro.py b/mesonbuild/mintro.py index 2312674..1fd0f3d 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: |