Skip to content

Commit c9b2b53

Browse files
committed
meson.build: Specify 'check' option in run_command()
The default value will be changed in future Meson releases. Don't use deprecated python3.path() and execute(..., gui_app: ...).
1 parent afac37a commit c9b2b53

File tree

8 files changed

+21
-19
lines changed

8 files changed

+21
-19
lines changed

.github/workflows/meson-clang-10.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ jobs:
1515
export ENV DEBIAN_FRONTEND=noninteractive
1616
sudo apt update
1717
sudo apt install libxml2-utils docbook5-xml docbook-xsl mm-common clang-10 ninja-build python3-setuptools python3-pip --yes
18-
# Ubuntu 20.04 contains meson 0.53.2, but libsigc++ requires meson >= 0.54.0.
18+
# Ubuntu 20.04 contains meson 0.53.2, but libsigc++ requires meson >= 0.55.0.
1919
# Install it with pip3 instead of apt.
20-
sudo pip3 install "meson>=0.54.0"
20+
sudo pip3 install "meson>=0.55.0"
2121
export CXX=clang++-10
2222
meson -Dwarnings=fatal _build
2323
cd _build

.github/workflows/meson-gcc-9.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ jobs:
1515
export ENV DEBIAN_FRONTEND=noninteractive
1616
sudo apt update
1717
sudo apt install libxml2-utils docbook5-xml docbook-xsl mm-common g++-9 ninja-build python3-setuptools python3-pip --yes
18-
# Ubuntu 20.04 contains meson 0.53.2, but libsigc++ requires meson >= 0.54.0.
18+
# Ubuntu 20.04 contains meson 0.53.2, but libsigc++ requires meson >= 0.55.0.
1919
# Install it with pip3 instead of apt.
20-
sudo pip3 install "meson>=0.54.0"
20+
sudo pip3 install "meson>=0.55.0"
2121
export CXX=g++-9
2222
meson -Dwarnings=fatal _build
2323
cd _build

MSVC_NMake/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ handle_built_files = project_source_root / 'tools' / 'handle-built-files.py'
2323
if can_add_dist_script
2424
# Distribute built files.
2525
meson.add_dist_script(
26-
python3.path(), handle_built_files, 'dist_gen_msvc_files',
26+
python3, handle_built_files, 'dist_gen_msvc_files',
2727
meson.current_build_dir(),
2828
untracked_msvc_nmake,
2929
project_build_root / 'sigc++config.h',

docs/docs/manual/meson.build

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ if xmllint.found()
3131
validate,
3232
meson.current_source_dir() / 'can_use_xmllint.xml',
3333
meson.current_build_dir() / 'can_use_xmllint.stamp',
34+
check: false,
3435
).returncode() == 0
3536
if not can_parse_and_validate
3637
# The DocBook V5.0 package is called docbook5-xml in Ubuntu,
@@ -95,7 +96,7 @@ endif
9596
if can_add_dist_script
9697
# Distribute built files.
9798
meson.add_dist_script(
98-
python3.path(), tutorial_custom_cmd, 'dist_doc',
99+
python3, tutorial_custom_cmd, 'dist_doc',
99100
doc_dist_dir,
100101
meson.current_build_dir(),
101102
meson.current_source_dir() / sigc_manual_xml,

docs/docs/reference/meson.build

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ devhelp_file = custom_target('devhelp',
120120

121121
# Install Devhelp file and html files.
122122
meson.add_install_script(
123-
python3.path(), doc_reference, 'install_doc',
123+
python3, doc_reference, 'install_doc',
124124
doctool_dir,
125125
devhelp_file.full_path(),
126126
install_devhelpdir,
@@ -131,7 +131,7 @@ meson.add_install_script(
131131
if can_add_dist_script
132132
# Distribute built files and files copied by mm-common-get.
133133
meson.add_dist_script(
134-
python3.path(), doc_reference, 'dist_doc',
134+
python3, doc_reference, 'dist_doc',
135135
doctool_dir,
136136
doctool_dist_dir,
137137
meson.current_build_dir(),

examples/meson.build

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ foreach ex : examples
2323
cpp_args: '-DSIGCXX_DISABLE_DEPRECATED',
2424
dependencies: sigcxx_own_dep,
2525
implicit_include_directories: false,
26-
gui_app: false,
2726
build_by_default: build_examples
2827
)
2928
endforeach

meson.build

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ project('libsigc++', 'cpp',
77
'cpp_std=c++17',
88
'warning_level=0',
99
],
10-
meson_version: '>= 0.54.0', # required for meson.override_dependency()
11-
# and dep.get_variable(internal:)
10+
meson_version: '>= 0.55.0', # required for meson.add_dist_script(python3, ...)
11+
# and meson.add_install_script(python3, ...)
1212
)
1313

1414
sigcxx_api_version = '3.0'
@@ -56,7 +56,7 @@ import os
5656
import sys
5757
sys.exit(os.path.isdir("@0@") or os.path.isfile("@0@"))
5858
'''.format(project_source_root / '.git')
59-
is_git_build = run_command(python3, '-c', cmd_py).returncode() != 0
59+
is_git_build = run_command(python3, '-c', cmd_py, check: false).returncode() != 0
6060

6161
# Are we testing a dist tarball while it's being built?
6262
# There ought to be a better way. https://github.com/mesonbuild/meson/issues/6866
@@ -130,14 +130,16 @@ tutorial_custom_cmd = project_source_root / 'tools' / 'tutorial-custom-cmd.py'
130130
if maintainer_mode
131131
# Copy files to untracked/build_scripts and untracked/docs/docs.
132132
run_command(mm_common_get, '--force', script_dir,
133-
project_source_root / 'untracked' / 'docs' / 'docs')
133+
project_source_root / 'untracked' / 'docs' / 'docs',
134+
check: true,
135+
)
134136
else
135137
cmd_py = '''
136138
import os
137139
import sys
138140
sys.exit(os.path.isfile("@0@"))
139141
'''.format(doc_reference)
140-
file_exists = run_command(python3, '-c', cmd_py).returncode() != 0
142+
file_exists = run_command(python3, '-c', cmd_py, check: false).returncode() != 0
141143
if not file_exists
142144
warning('Missing files in untracked/. ' + \
143145
'Enable maintainer-mode if you want to build documentation or create a dist tarball.')
@@ -148,7 +150,9 @@ endif
148150
doc_perl_prop = run_command(
149151
python3, doc_reference, 'get_script_property',
150152
'', # MMDOCTOOLDIR is not used
151-
'requires_perl')
153+
'requires_perl',
154+
check: false,
155+
)
152156
if not (doc_perl_prop.returncode() == 0 and doc_perl_prop.stdout() == 'false')
153157
# Perl is required, if documentation shall be built.
154158
perl = find_program('perl', required: build_documentation)
@@ -243,13 +247,13 @@ subdir('docs/docs/manual')
243247
if can_add_dist_script
244248
# Add a ChangeLog file to the distribution directory.
245249
meson.add_dist_script(
246-
python3.path(), dist_changelog,
250+
python3, dist_changelog,
247251
project_source_root,
248252
)
249253
# Add build scripts to the distribution directory, and delete .gitignore
250254
# files and an empty $MESON_PROJECT_DIST_ROOT/build/ directory.
251255
meson.add_dist_script(
252-
python3.path(), dist_build_scripts,
256+
python3, dist_build_scripts,
253257
project_source_root,
254258
'untracked' / 'build_scripts',
255259
)

tests/meson.build

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ foreach ex : test_programs
6767
exe_file = executable(ex_name, ex_sources,
6868
dependencies: sigcxx_own_dep,
6969
implicit_include_directories: false,
70-
gui_app: false,
7170
build_by_default: true
7271
)
7372

@@ -89,7 +88,6 @@ if can_benchmark
8988
exe_file = executable(ex_name, ex_sources,
9089
dependencies: [sigcxx_own_dep, benchmark_dep],
9190
implicit_include_directories: false,
92-
gui_app: false,
9391
build_by_default: do_benchmark
9492
)
9593

0 commit comments

Comments
 (0)