[gtkmm/gtkmm-3-24] meson.build: Specify 'check' option in run_command()



commit 032b61b72e641e171aaaf7eb0a227bffb4cd4826
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date:   Fri Feb 18 10:41:04 2022 +0100

    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: ...).
    Let import('python').find_installation() always find the python
    installation used to run Meson.
    Fixes #111

 demos/gtk-demo/meson.build |  2 +-
 docs/reference/meson.build |  4 ++--
 gdk/gdkmm/meson.build      |  5 +++--
 gtk/gtkmm/meson.build      |  5 +++--
 meson.build                | 19 ++++++++++---------
 tests/meson.build          |  2 +-
 6 files changed, 20 insertions(+), 17 deletions(-)
---
diff --git a/demos/gtk-demo/meson.build b/demos/gtk-demo/meson.build
index ca38b2a8..dcb318fa 100644
--- a/demos/gtk-demo/meson.build
+++ b/demos/gtk-demo/meson.build
@@ -48,7 +48,7 @@ if epoxy_dep.found()
     gtkmm_demo_cc_files, demo_resources,
     dependencies: [gtkmm_own_dep, epoxy_dep],
     implicit_include_directories: false,
-    gui_app: true,
+    win_subsystem: 'windows',
     build_by_default: build_demos,
     link_args: gui_app_ldflags,
     cpp_args: gtkmm_extra_gendef_cpp_args,
diff --git a/docs/reference/meson.build b/docs/reference/meson.build
index 2860046b..3902de2d 100644
--- a/docs/reference/meson.build
+++ b/docs/reference/meson.build
@@ -155,7 +155,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,
@@ -178,7 +178,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(),
diff --git a/gdk/gdkmm/meson.build b/gdk/gdkmm/meson.build
index 1b422bf9..e1f3b43d 100644
--- a/gdk/gdkmm/meson.build
+++ b/gdk/gdkmm/meson.build
@@ -199,6 +199,7 @@ else # not maintainer_mode
     meson.current_build_dir(),
     src_untracked_gdkmm,
     gdkmm_hg_ccg_basenames,
+    check: true,
   )
 
   built_cc_files = [ '../..' / untracked_gdkmm / 'wrap_init.cc' ]
@@ -275,7 +276,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 / gdkmm_pcname / 'gdkmm', # subdir below {prefix}
   gdkmm_used_hg_ccg_basenames
@@ -284,7 +285,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_gdkmm,
     gdkmm_hg_ccg_basenames,
diff --git a/gtk/gtkmm/meson.build b/gtk/gtkmm/meson.build
index 4d89f97f..d87e6eb1 100644
--- a/gtk/gtkmm/meson.build
+++ b/gtk/gtkmm/meson.build
@@ -462,6 +462,7 @@ else # not maintainer_mode
     meson.current_build_dir(),
     src_untracked_gtkmm,
     gtkmm_hg_ccg_basenames,
+    check: true,
   )
 
   built_cc_files = [ '../..' / untracked_gtkmm / 'wrap_init.cc' ]
@@ -543,7 +544,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 / gtkmm_pcname / 'gtkmm', # subdir below {prefix}
   gtkmm_used_hg_ccg_basenames
@@ -552,7 +553,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_gtkmm,
     gtkmm_hg_ccg_basenames,
diff --git a/meson.build b/meson.build
index a748a67d..fc94c958 100644
--- a/meson.build
+++ b/meson.build
@@ -7,8 +7,7 @@ project('gtkmm', 'c', 'cpp',
   default_options: [
     'cpp_std=c++11'
   ],
-  meson_version: '>= 0.54.0', # required for meson.override_dependency()
-                              # and dep.get_variable(internal:)
+  meson_version: '>= 0.56.0', # required for executable(win_subsystem:)
 )
 
 gtkmm_api_version = '3.0'
@@ -47,7 +46,7 @@ project_build_root = meson.current_build_dir()
 cpp_compiler = meson.get_compiler('cpp')
 is_msvc = cpp_compiler.get_id() == 'msvc'
 is_host_windows = host_machine.system() == 'windows'
-python3 = import('python').find_installation('python3')
+python3 = import('python').find_installation()
 
 python_version = python3.language_version()
 python_version_req = '>= 3.5'
@@ -62,7 +61,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
@@ -229,14 +228,16 @@ check_dllexport_usage_py = script_dir / 'check-dllexport-usage.py'
 if maintainer_mode
   # Copy files to untracked/build_scripts and untracked/doc.
   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
@@ -275,7 +276,7 @@ if is_msvc
 
   # Enable __declspec(dllexport) if the gtkmm headers generated from the .hg files
   # were generated using a recent enough gmmproc
-  build_shared_libs_directly = run_command(check_gmmproc_ver_cmd).returncode() == 0
+  build_shared_libs_directly = run_command(check_gmmproc_ver_cmd, check: false).returncode() == 0
   message('Using __declspec(dllexport) to build gtkmm: @0@'.format(build_shared_libs_directly ? 'YES' : 
'NO'))
   if not build_shared_libs_directly
     gdkmm_extra_gendef_cpp_args += '-DGDKMM_USE_GENDEF'
@@ -366,7 +367,7 @@ 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,
   )
 
@@ -380,7 +381,7 @@ if can_add_dist_script
   # 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',
     dont_distribute,
diff --git a/tests/meson.build b/tests/meson.build
index 679e8877..60590c68 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -36,7 +36,7 @@ foreach ex : test_programs
   exe_file = executable(ex_name, ex_sources,
     dependencies: ex[3] ? gtkmm_own_dep : gdkmm_own_dep,
     implicit_include_directories: false,
-    gui_app: ex[3],
+    win_subsystem: ex[3] ? 'windows' : 'console',
     build_by_default: build_tests,
     link_args: ex[3] ? gui_app_ldflags : [],
     cpp_args: gtkmm_extra_gendef_cpp_args,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]