Skip to content

Commit

Permalink
meson.build: Specify 'check' option in run_command()
Browse files Browse the repository at this point in the history
The default value will be changed in future Meson releases.

Don't use deprecated python3.path() and execute(..., gui_app: ...).
  • Loading branch information
kjellahl committed Feb 11, 2022
1 parent 6f9483e commit 88d8790
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 17 deletions.
2 changes: 1 addition & 1 deletion MSVC_NMake/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ handle_built_files = project_source_root / 'tools' / 'handle-built-files.py'
if can_add_dist_script
# Distribute built files.
meson.add_dist_script(
python3.path(), handle_built_files, 'dist_gen_msvc_files',
python3, handle_built_files, 'dist_gen_msvc_files',
meson.current_build_dir(),
untracked_msvc_nmake,
project_build_root / 'sigc++config.h',
Expand Down
3 changes: 2 additions & 1 deletion docs/manual/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ if xmllint.found()
validate,
meson.current_source_dir() / 'can_use_xmllint.xml',
meson.current_build_dir() / 'can_use_xmllint.stamp',
check: false,
).returncode() == 0
if not can_parse_and_validate
# The DocBook V5.0 package is called docbook5-xml in Ubuntu,
Expand Down Expand Up @@ -100,7 +101,7 @@ endif
if can_add_dist_script
# Distribute built files.
meson.add_dist_script(
python3.path(), tutorial_custom_cmd, 'dist_doc',
python3, tutorial_custom_cmd, 'dist_doc',
doc_dist_dir,
meson.current_build_dir(),
meson.current_source_dir() / sigc_manual_xml,
Expand Down
4 changes: 2 additions & 2 deletions docs/reference/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ devhelp_file = custom_target('devhelp',

# Install Devhelp file and html files.
meson.add_install_script(
python3.path(), doc_reference, 'install_doc',
python3, doc_reference, 'install_doc',
doctool_dir,
devhelp_file.full_path(),
install_devhelpdir,
Expand All @@ -156,7 +156,7 @@ meson.add_install_script(
if can_add_dist_script
# Distribute built files and files copied by mm-common-get.
meson.add_dist_script(
python3.path(), doc_reference, 'dist_doc',
python3, doc_reference, 'dist_doc',
doctool_dir,
doctool_dist_dir,
meson.current_build_dir(),
Expand Down
1 change: 0 additions & 1 deletion examples/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ foreach ex : examples
cpp_args: '-DSIGCXX_DISABLE_DEPRECATED',
dependencies: sigcxx_own_dep,
implicit_include_directories: false,
gui_app: false,
build_by_default: build_examples
)
endforeach
20 changes: 12 additions & 8 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ project('libsigc++', 'cpp',
'cpp_std=c++11',
'warning_level=0',
],
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, ...)
)

sigcxx_api_version = '2.0'
Expand Down Expand Up @@ -56,7 +56,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
Expand Down Expand Up @@ -127,14 +127,16 @@ tutorial_custom_cmd = project_source_root / 'tools' / 'tutorial-custom-cmd.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(doc_reference)
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
warning('Missing files in untracked/. You may have to enable maintainer-mode.')
endif
Expand All @@ -144,7 +146,9 @@ endif
doc_perl_prop = run_command(
python3, doc_reference, 'get_script_property',
'', # MMDOCTOOLDIR is not used
'requires_perl')
'requires_perl',
check: false,
)
if not (doc_perl_prop.returncode() == 0 and doc_perl_prop.stdout() == 'false')
# Perl is required, if documentation shall be built.
perl = find_program('perl', required: build_documentation)
Expand Down Expand Up @@ -246,13 +250,13 @@ subdir('docs/manual')
if can_add_dist_script
# Add a ChangeLog file to the distribution directory.
meson.add_dist_script(
python3.path(), dist_changelog,
python3, dist_changelog,
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,
python3, dist_build_scripts,
project_source_root,
'untracked' / 'build_scripts',
)
Expand Down
5 changes: 3 additions & 2 deletions sigc++/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ else # not maintainer_mode
meson.current_build_dir(),
src_untracked_sigcxx,
built_h_files + built_cc_files,
check: true,
)

untracked_built_cc_files = []
Expand All @@ -167,7 +168,7 @@ endif

# Install built .h files.
meson.add_install_script(
python3.path(), handle_built_files, 'install_built_h_files',
python3, handle_built_files, 'install_built_h_files',
built_h_cc_dir,
install_includedir / sigcxx_pcname / 'sigc++', # subdir below {prefix}
built_h_files,
Expand All @@ -176,7 +177,7 @@ meson.add_install_script(
if can_add_dist_script
# Distribute built files.
meson.add_dist_script(
python3.path(), handle_built_files, 'dist_built_files',
python3, handle_built_files, 'dist_built_files',
built_h_cc_dir,
untracked_sigcxx,
built_h_files + built_cc_files,
Expand Down
2 changes: 0 additions & 2 deletions tests/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ foreach ex : test_programs
exe_file = executable(ex_name, ex_sources,
dependencies: sigcxx_own_dep,
implicit_include_directories: false,
gui_app: false,
build_by_default: true
)

Expand All @@ -81,7 +80,6 @@ if can_benchmark
exe_file = executable(ex_name, ex_sources,
dependencies: [sigcxx_own_dep, benchmark_dep],
implicit_include_directories: false,
gui_app: false,
build_by_default: do_benchmark
)

Expand Down

0 comments on commit 88d8790

Please sign in to comment.