summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/reference/meson.build5
-rw-r--r--meson.build11
2 files changed, 9 insertions, 7 deletions
diff --git a/docs/reference/meson.build b/docs/reference/meson.build
index 91bf6e2..4cdcdc8 100644
--- a/docs/reference/meson.build
+++ b/docs/reference/meson.build
@@ -2,7 +2,7 @@
# Input: project_build_root, project_source_root, cairomm_pcname,
# build_documentation, source_h_files, install_datadir, python3,
-# doc_reference_py
+# doc_reference_py, can_add_dist_script
# Output: install_docdir, install_devhelpdir, book_name, tag_file
# There are no built source files in cairomm.
@@ -113,9 +113,8 @@ meson.add_install_script(
docinstall_flags
)
-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 66d10c7..c3ba43e 100644
--- a/meson.build
+++ b/meson.build
@@ -257,6 +257,9 @@ cairommconfig_h = configure_file(
install_dir: install_includeconfigdir,
)
+# 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('MSVC_NMake/cairomm')
subdir('data')
subdir('cairomm')
@@ -264,9 +267,8 @@ 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,
@@ -284,8 +286,9 @@ if not meson.is_subproject()
'untracked' / 'build_scripts',
dont_distribute,
)
-else
- # This is a subproject.
+endif
+
+if meson.is_subproject()
cairomm_dep = declare_dependency(
dependencies: cairomm_own_dep,
variables: {