From 4c987ce96cf0aa01c9141cc161f22e9f49950595 Mon Sep 17 00:00:00 2001 From: Ankith Date: Tue, 19 Dec 2023 23:18:08 +0530 Subject: [PATCH] Workaround extra .lib inclusion with meson tags --- buildconfig/stubs/meson.build | 1 + docs/meson.build | 1 + meson.build | 4 ++-- pyproject.toml | 3 ++- src_py/meson.build | 2 +- test/meson.build | 2 +- 6 files changed, 8 insertions(+), 5 deletions(-) diff --git a/buildconfig/stubs/meson.build b/buildconfig/stubs/meson.build index 6fa173b64d..b20178f4a8 100644 --- a/buildconfig/stubs/meson.build +++ b/buildconfig/stubs/meson.build @@ -3,4 +3,5 @@ install_subdir( exclude_files: '.flake8', install_dir: pg_dir, strip_directory: true, + install_tag: 'pg-tag', ) diff --git a/docs/meson.build b/docs/meson.build index 544f78f758..6fe2b1c314 100644 --- a/docs/meson.build +++ b/docs/meson.build @@ -9,6 +9,7 @@ if fs.is_dir('generated') ], exclude_files: ['.buildinfo', 'objects.inv'], install_dir: pg_dir / 'docs', + install_tag: 'pg-tag', ) elif get_option('error_docs_missing') error('The "generated" docs folder does not exist!') diff --git a/meson.build b/meson.build index 0c67407089..a9ec3765c7 100644 --- a/meson.build +++ b/meson.build @@ -149,7 +149,7 @@ if plat == 'win' and host_machine.cpu_family().startswith('x86') endif # put dlls in root of install - install_data(dlls, install_dir: pg_dir) + install_data(dlls, install_dir: pg_dir, install_tag: 'pg-tag') else bases = ['/usr/local', '/usr', '/opt/homebrew', '/opt/local'] foreach inc_dir : bases @@ -346,6 +346,6 @@ if not get_option('stripped') subdir('docs') subdir('test') subdir('buildconfig/stubs') - install_subdir('examples', install_dir: pg_dir) + install_subdir('examples', install_dir: pg_dir, install_tag: 'pg-tag') # TODO: install headers? not really important though endif diff --git a/pyproject.toml b/pyproject.toml index 4951144c55..bfefd2066c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -51,8 +51,9 @@ hook-dirs = 'pygame.__pyinstaller:get_hook_dirs' requires = ["meson-python", "ninja"] # add cython here when needed build-backend = 'mesonpy' +[tool.meson-python.args] +install = ['--tags=runtime,python-runtime,pg-tag'] # uncomment to get werror locally -# [tool.meson-python.args] # setup = ["-Derror_on_warns=true"] [tool.cibuildwheel.config-settings] diff --git a/src_py/meson.build b/src_py/meson.build index eaa379ac28..c312ba1e77 100644 --- a/src_py/meson.build +++ b/src_py/meson.build @@ -34,7 +34,7 @@ data_files = files( 'pygame_icon.icns', 'pygame_icon_mac.bmp', ) -install_data(data_files, install_dir: pg_dir) +install_data(data_files, install_dir: pg_dir, install_tag: 'pg-tag') subdir('_sdl2') subdir('__pyinstaller') diff --git a/test/meson.build b/test/meson.build index 9cedee1779..90fdaf929a 100644 --- a/test/meson.build +++ b/test/meson.build @@ -58,5 +58,5 @@ test_files = files( py.install_sources(test_files, subdir: pg / 'tests') -install_subdir('fixtures', install_dir: pg_dir / 'tests') +install_subdir('fixtures', install_dir: pg_dir / 'tests', install_tag: 'pg-tag') subdir('test_utils')