[pangomm/pangomm-2-46] Subprojects can use meson.add_dist_script() if meson.version() >= 0.58.0



commit a791aa61abe19c167a0cb123a91856072b66e867
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date:   Wed May 5 18:19:22 2021 +0200

    Subprojects can use meson.add_dist_script() if meson.version() >= 0.58.0
    
    Call add_dist_script() in a subproject, if meson.version() >= 0.58.0.

 docs/reference/meson.build |  5 ++---
 meson.build                | 11 +++++++----
 pango/pangomm/meson.build  |  5 ++---
 3 files changed, 11 insertions(+), 10 deletions(-)
---
diff --git a/docs/reference/meson.build b/docs/reference/meson.build
index 7f7cc5f..ed3808a 100644
--- a/docs/reference/meson.build
+++ b/docs/reference/meson.build
@@ -2,7 +2,7 @@
 
 # Input: built_files_root, project_source_root, pangomm_pcname, python3,
 #        hg_ccg_basenames, extra_h_files, built_h_file_targets, install_datadir,
-#        doc_reference_py
+#        doc_reference_py, can_add_dist_script
 # Output: install_docdir, install_devhelpdir, tag_file
 
 tag_file_modules = [
@@ -149,9 +149,8 @@ endforeach
 
 install_data(image_files, install_dir: install_image_docdir)
 
-if not meson.is_subproject()
+if can_add_dist_script
   # Distribute built files and files copied by mm-common-get.
-  # (add_dist_script() is not allowed in a subproject)
   meson.add_dist_script(
     python3.path(), doc_reference_py, 'dist_doc',
     doctool_dir,
diff --git a/meson.build b/meson.build
index 4d1d330..3a98a0d 100644
--- a/meson.build
+++ b/meson.build
@@ -251,6 +251,9 @@ if is_msvc
   endforeach
 endif
 
+# add_dist_script() is not allowed in a subproject if meson.version() < 0.58.0.
+can_add_dist_script = not meson.is_subproject() or meson.version().version_compare('>= 0.58.0')
+
 subdir('tools/extra_defs_gen')
 subdir('MSVC_NMake/gendef')
 subdir('pango')
@@ -258,9 +261,8 @@ subdir('MSVC_NMake/pangomm')
 subdir('pango/pangomm')
 subdir('docs/reference')
 
-if not meson.is_subproject()
+if can_add_dist_script
   # Add a ChangeLog file to the distribution directory.
-  # (add_dist_script() is not allowed in a subproject)
   meson.add_dist_script(
     python3.path(), dist_changelog_py,
     project_source_root,
@@ -272,8 +274,9 @@ if not meson.is_subproject()
     project_source_root,
     'untracked' / 'build_scripts',
   )
-else
-  # This is a subproject.
+endif
+
+if meson.is_subproject()
   pangomm_dep = declare_dependency(
     dependencies: pangomm_own_dep,
     variables: {
diff --git a/pango/pangomm/meson.build b/pango/pangomm/meson.build
index 299748c..cc3741d 100644
--- a/pango/pangomm/meson.build
+++ b/pango/pangomm/meson.build
@@ -3,7 +3,7 @@
 # Input: pangomm_build_dep, pangomm_pcname, maintainer_mode, project_source_root,
 #        generate_binding_py, m4_files, pangomm_libversion, install_includedir,
 #        python3, pangomm_rc, dummy_header_py, gmmproc_dir, build_shared_libs_directly,
-#        msvc14x_toolset_ver, macos_darwin_versions
+#        msvc14x_toolset_ver, macos_darwin_versions, can_add_dist_script
 # Output: hg_ccg_basenames, extra_h_files, built_h_file_targets, built_files_root,
 #         pangomm_own_dep
 
@@ -260,9 +260,8 @@ meson.add_install_script(
   hg_ccg_basenames
 )
 
-if not meson.is_subproject()
+if can_add_dist_script
   # Distribute built files.
-  # (add_dist_script() is not allowed in a subproject)
   meson.add_dist_script(
     python3.path(), generate_binding_py, 'dist_built_files',
     built_h_cc_dir,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]