From 737cda575de1544a61304a2dbdc7543432657a23 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Fri, 5 Jan 2024 15:44:22 -0800 Subject: [PATCH] sage-generate-meson: Improve option --monolithic --- src/sage_setup/autogen/meson/__init__.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/sage_setup/autogen/meson/__init__.py b/src/sage_setup/autogen/meson/__init__.py index daf90d7a732..3fd2865fd60 100644 --- a/src/sage_setup/autogen/meson/__init__.py +++ b/src/sage_setup/autogen/meson/__init__.py @@ -292,7 +292,7 @@ def get_metadata(path: Path): meson_build.write(' )\n') meson_build.write('endforeach\n') - if files.install_subdirs: + if not monolithic and files.install_subdirs: for subdir in files.install_subdirs: meson_build.write(f"install_subdir('{subdir.name}', install_dir: sage_install_dir / '{folder_rel_to_src.relative_to('sage')}')\n") meson_build.write('\n') @@ -303,8 +303,11 @@ def get_metadata(path: Path): meson_build.write('\n') if monolithic: - for subdir, _ in recurse_subdirs.items(): - meson_build.write(f"subdir('{subdir.name}')\n") + for subdir in sorted(set(recurse_subdirs).union(files.install_subdirs)): + if subdir in recurse_subdirs: + meson_build.write(f"subdir('{subdir.name}')\n") + else: + meson_build.write(f"install_subdir('{subdir.name}', install_dir: sage_install_dir / '{folder_rel_to_src.relative_to('sage')}')\n") else: for subdir, subdir_distributions in recurse_subdirs.items(): condition = " or ".join(distribution_condition(distribution)