Skip to content

Commit 0923202

Browse files
committed
meson.build: Check if Perl is required for building documentation
New versions of mm-common use the Python scripts doc_postprocess.py and doc_install.py instead of the Perl scripts doc-postprocess.pl and doc-install.pl when documentation is built.
1 parent d9319e4 commit 0923202

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

meson.build

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@ if maintainer_mode and not mm_common_get.found()
161161
# subproject only if mm-common-get is required.
162162
mm_common_get = find_program('mm-common-get', required: true)
163163
endif
164-
perl = find_program('perl', required: build_documentation)
165164
doxygen = find_program('doxygen', required: build_documentation)
166165
dot = find_program('dot', required: build_documentation) # Used by Doxygen
167166
xsltproc = find_program('xsltproc', required: build_documentation)
@@ -172,6 +171,10 @@ doc_reference_py = script_dir / 'doc-reference.py'
172171
dist_changelog_py = script_dir / 'dist-changelog.py'
173172
dist_build_scripts_py = script_dir / 'dist-build-scripts.py'
174173

174+
# xmlxx's own script files.
175+
xmlxx_script_dir = project_source_root / 'tools' / 'build_scripts'
176+
tutorial_custom_cmd_py = xmlxx_script_dir / 'tutorial-custom-cmd.py'
177+
175178
if maintainer_mode
176179
# Copy files to untracked/build_scripts and untracked/docs.
177180
run_command(mm_common_get, '--force', script_dir,
@@ -189,9 +192,15 @@ sys.exit(os.path.isfile("@0@"))
189192
endif
190193
endif
191194

192-
# xmlxx's own script files.
193-
xmlxx_script_dir = project_source_root / 'tools' / 'build_scripts'
194-
tutorial_custom_cmd_py = xmlxx_script_dir / 'tutorial-custom-cmd.py'
195+
# Check if perl is required and available.
196+
doc_perl_prop = run_command(
197+
python3, doc_reference_py, 'get_script_property',
198+
'', # MMDOCTOOLDIR is not used
199+
'requires_perl')
200+
if not (doc_perl_prop.returncode() == 0 and doc_perl_prop.stdout() == 'false')
201+
# Perl is required, if documentation shall be built.
202+
perl = find_program('perl', required: build_documentation)
203+
endif
195204

196205
# Add toolset version in builds done with Visual Studio 2017 or later
197206
msvc14x_toolset_ver = ''

untracked/README

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ or the tarball is created with Meson.
1515

1616
1. Files copied by mm-common-get
1717
--------------------------------
18-
untracked/docs/doc-install.pl
19-
doc-postprocess.pl
18+
untracked/docs/doc_install.py or doc-install.pl
19+
doc_postprocess.py or doc-postprocess.pl
2020
doxygen-extra.css
2121
tagfile-to-devhelp2.xsl
2222
untracked/build_scripts/dist-build-scripts.py

0 commit comments

Comments
 (0)