[glibmm] Subprojects can use meson.add_dist_script() if meson.version() >= 0.58.0
- From: Kjell Ahlstedt <kjellahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glibmm] Subprojects can use meson.add_dist_script() if meson.version() >= 0.58.0
- Date: Wed, 5 May 2021 10:28:10 +0000 (UTC)
commit 983668cfd40f5eed4a555922586826ccdef560de
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date: Wed May 5 10:59:53 2021 +0200
Subprojects can use meson.add_dist_script() if meson.version() >= 0.58.0
* meson.build:
* docs/reference/meson.build:
* gio/giomm/meson.build:
* glib/glibmm/meson.build:
Call add_dist_script() in a subproject, if meson.version() >= 0.58.0.
* tools/build_scripts/handle-built-files.py:
Use MESON_PROJECT_DIST_ROOT if it exists, else MESON_DIST_ROOT.
It exists if meson.version() >= 0.58.0.
docs/reference/meson.build | 5 ++---
gio/giomm/meson.build | 5 ++---
glib/glibmm/meson.build | 5 ++---
meson.build | 12 +++++++-----
tools/build_scripts/handle-built-files.py | 7 +++++--
5 files changed, 18 insertions(+), 16 deletions(-)
---
diff --git a/docs/reference/meson.build b/docs/reference/meson.build
index 1c3e7579..8e866ec1 100644
--- a/docs/reference/meson.build
+++ b/docs/reference/meson.build
@@ -4,7 +4,7 @@
# glibmm_hg_ccg_basenames, giomm_hg_ccg_basenames, build_documentation,
# glibmm_extra_h_files, giomm_extra_h_files, glibmm_built_h_file_targets,
# giomm_built_h_file_targets, glibmm_h_m4_files, install_datadir,
-# python3, doc_reference_py
+# python3, doc_reference_py, can_add_dist_script
# Output: install_docdir, install_devhelpdir, tag_file
tag_file_modules = [
@@ -161,9 +161,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/gio/giomm/meson.build b/gio/giomm/meson.build
index fad7ce98..2f2193e3 100644
--- a/gio/giomm/meson.build
+++ b/gio/giomm/meson.build
@@ -4,7 +4,7 @@
# generate_binding_py, handle_built_files_py, m4_files, pm_files,
# glibmm_libversion, install_includedir, python3, giomm_rc, gmmproc_dir,
# is_host_windows, gmmproc, generate_wrap_init_pl, giomm_libname,
-# macos_darwin_versions
+# macos_darwin_versions, can_add_dist_script
# Output: giomm_hg_ccg_basenames, giomm_extra_h_files, built_files_root,
# giomm_built_h_file_targets, giomm_own_dep
@@ -381,9 +381,8 @@ meson.add_install_script(
giomm_used_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,
diff --git a/glib/glibmm/meson.build b/glib/glibmm/meson.build
index 5ba85320..b736a3cf 100644
--- a/glib/glibmm/meson.build
+++ b/glib/glibmm/meson.build
@@ -4,7 +4,7 @@
# generate_binding_py, handle_built_files_py, m4_files, pm_files,
# glibmm_libversion, install_includedir, python3, glibmm_rc, gmmproc_dir,
# is_host_windows, gmmproc, generate_wrap_init_pl, glibmm_libname,
-# macos_darwin_versions
+# macos_darwin_versions, can_add_dist_script
# Output: glibmm_hg_ccg_basenames, glibmm_extra_h_files, built_files_root,
# glibmm_built_h_file_targets, glibmm_h_m4_files, glibmm_own_dep
@@ -328,9 +328,8 @@ meson.add_install_script(
glibmm_h_m4_files,
)
-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,
diff --git a/meson.build b/meson.build
index fdc59966..2f7144a5 100644
--- a/meson.build
+++ b/meson.build
@@ -229,6 +229,9 @@ endif
glibmm_libname = meson.project_name() + msvc14x_toolset_ver + '-' + glibmm_api_version
giomm_libname = 'giomm' + msvc14x_toolset_ver + '-' + glibmm_api_version
+# 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')
subdir('glib')
subdir('MSVC_NMake/glibmm')
@@ -240,23 +243,22 @@ subdir('examples')
subdir('tests')
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,
)
# Add build scripts to the distribution directory, and delete .gitignore
- # files and an empty $MESON_DIST_ROOT/build/ directory.
+ # files and an empty $MESON_PROJECT_DIST_ROOT/build/ directory.
meson.add_dist_script(
python3.path(), dist_build_scripts_py,
project_source_root,
'untracked' / 'build_scripts',
)
-else
- # This is a subproject.
+endif
+if meson.is_subproject()
# A version of gmmproc that can be executed uninstalled by a main project.
conf_data_subproj = configuration_data()
conf_data_subproj.merge_from(gmmproc_conf_data)
diff --git a/tools/build_scripts/handle-built-files.py b/tools/build_scripts/handle-built-files.py
index 862ab5f7..e22600b4 100755
--- a/tools/build_scripts/handle-built-files.py
+++ b/tools/build_scripts/handle-built-files.py
@@ -123,9 +123,12 @@ def dist_built_files(is_msvc_files=False):
# <built_h_cc_dir> <dist_dir> <built_files>...
# <built_h_cc_dir> is an absolute path in the build directory or source directory.
- # <dist_dir> is a distribution directory, relative to MESON_DIST_ROOT.
+ # <dist_dir> is a distribution directory, relative to MESON_PROJECT_DIST_ROOT.
+
+ # MESON_PROJECT_DIST_ROOT is set only if meson.version() >= 0.58.0.
+ project_dist_root = os.getenv('MESON_PROJECT_DIST_ROOT', os.getenv('MESON_DIST_ROOT'))
built_h_cc_dir = sys.argv[2]
- dist_dir_root = os.path.join(os.getenv('MESON_DIST_ROOT'), sys.argv[3])
+ dist_dir_root = os.path.join(project_dist_root, sys.argv[3])
dist_dir = dist_dir_root
# Distribute .h and .cc files built from .m4 files, or generated MSVC files.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]