Commit a192e7fc authored by Kjell Ahlstedt's avatar Kjell Ahlstedt
Browse files

meson.build: Specify 'check' option in run_command()

The default value will be changed in future Meson releases.

Don't use deprecated python3.path().
Let import('python').find_installation() always find the python
installation used to run Meson.
parent 85996178
Pipeline #365930 passed with stages
in 6 minutes and 45 seconds
......@@ -142,7 +142,7 @@ devhelp_file = custom_target('devhelp',
# Install Devhelp file and html files.
meson.add_install_script(
python3.path(), doc_reference_py, 'install_doc',
python3, doc_reference_py, 'install_doc',
doctool_dir,
devhelp_file.full_path(),
install_devhelpdir,
......@@ -165,7 +165,7 @@ install_data(image_files, install_dir: install_image_docdir)
if can_add_dist_script
# Distribute built files and files copied by mm-common-get.
meson.add_dist_script(
python3.path(), doc_reference_py, 'dist_doc',
python3, doc_reference_py, 'dist_doc',
doctool_dir,
doctool_dist_dir,
meson.current_build_dir(),
......
......@@ -6,8 +6,8 @@ project('pangomm', 'cpp',
default_options: [
'cpp_std=c++17'
],
meson_version: '>= 0.54.0', # required for meson.override_dependency()
# and dep.get_variable(internal:)
meson_version: '>= 0.55.0', # required for meson.add_dist_script(python3, ...)
# and meson.add_install_script(python3, ...)
)
pangomm_api_version = '2.48'
......@@ -44,7 +44,7 @@ project_build_root = meson.current_build_dir()
cpp_compiler = meson.get_compiler('cpp')
is_msvc = cpp_compiler.get_id() == 'msvc'
python3 = import('python').find_installation('python3')
python3 = import('python').find_installation()
python_version = python3.language_version()
python_version_req = '>= 3.5'
......@@ -59,7 +59,7 @@ import os
import sys
sys.exit(os.path.isdir("@0@") or os.path.isfile("@0@"))
'''.format(project_source_root / '.git')
is_git_build = run_command(python3, '-c', cmd_py).returncode() != 0
is_git_build = run_command(python3, '-c', cmd_py, check: false).returncode() != 0
# Are we testing a dist tarball while it's being built?
# There ought to be a better way. https://github.com/mesonbuild/meson/issues/6866
......@@ -147,14 +147,16 @@ dist_build_scripts_py = script_dir / 'dist-build-scripts.py'
if maintainer_mode
# Copy files to untracked/build_scripts and untracked/docs.
run_command(mm_common_get, '--force', script_dir,
project_source_root / 'untracked' / 'docs')
project_source_root / 'untracked' / 'docs',
check: true,
)
else
cmd_py = '''
import os
import sys
sys.exit(os.path.isfile("@0@"))
'''.format(generate_binding_py)
file_exists = run_command(python3, '-c', cmd_py).returncode() != 0
file_exists = run_command(python3, '-c', cmd_py, check: false).returncode() != 0
if not file_exists
error('Missing files in untracked/. You must enable maintainer-mode.')
endif
......@@ -236,13 +238,13 @@ subdir('docs/reference')
if can_add_dist_script
# Add a ChangeLog file to the distribution directory.
meson.add_dist_script(
python3.path(), dist_changelog_py,
python3, dist_changelog_py,
project_source_root,
)
# Add build scripts to the distribution directory, and delete .gitignore
# files and an empty $MESON_PROJECT_DIST_ROOT/build/ directory.
meson.add_dist_script(
python3.path(), dist_build_scripts_py,
python3, dist_build_scripts_py,
project_source_root,
'untracked' / 'build_scripts',
)
......
......@@ -193,6 +193,7 @@ else # not maintainer_mode
meson.current_build_dir(),
src_untracked_pangomm,
hg_ccg_basenames,
check: true,
)
built_cc_files = [ rel_untracked_pangomm / 'wrap_init.cc' ]
......@@ -219,7 +220,7 @@ endif
# Install built .h and _p.h files.
meson.add_install_script(
python3.path(), generate_binding_py, 'install_built_h_files',
python3, generate_binding_py, 'install_built_h_files',
built_h_cc_dir,
install_includedir / pangomm_pcname / 'pangomm', # subdir below {prefix}
hg_ccg_basenames
......@@ -228,7 +229,7 @@ meson.add_install_script(
if can_add_dist_script
# Distribute built files.
meson.add_dist_script(
python3.path(), generate_binding_py, 'dist_built_files',
python3, generate_binding_py, 'dist_built_files',
built_h_cc_dir,
untracked_pangomm,
hg_ccg_basenames,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment