[balsa: 1/2] meson.build: More run_command() check kwargs




commit 9a93a4d29478f66134ee25c8023800b92dd529fa
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Wed Aug 10 17:54:43 2022 -0400

    meson.build: More run_command() check kwargs
    
    modified:   images/meson.build
    modified:   libnetclient/meson.build
    modified:   libnetclient/test/meson.build
    modified:   meson.build

 images/meson.build            |  9 ++++++---
 libnetclient/meson.build      |  2 +-
 libnetclient/test/meson.build | 10 ++++++----
 meson.build                   | 13 +++++++------
 4 files changed, 20 insertions(+), 14 deletions(-)
---
diff --git a/images/meson.build b/images/meson.build
index cf81c39e9..b2d16e167 100644
--- a/images/meson.build
+++ b/images/meson.build
@@ -17,7 +17,10 @@ balsabitmapsdir = join_paths(get_option('datadir'), 'balsa', 'pixmaps')
 install_data(balsa_imgs, install_dir : balsabitmapsdir)
 
 if gtk_update_icon_cache_program.found()
-  gtk_update_icon_cache = gtk_update_icon_cache_program.path()
   icon_cache_dir = join_paths(get_option('prefix'), get_option('datadir'), 'balsa')
-  run_command(gtk_update_icon_cache, '--ignore-theme-index', icon_cache_dir)
-endif
+  result = run_command(gtk_update_icon_cache_program, '--ignore-theme-index', icon_cache_dir,
+                       check : false)
+  if result.returncode() != 0
+    warning(result.stderr())
+  endif # result.returncode() != 0
+endif # gtk_update_icon_cache_program.found()
diff --git a/libnetclient/meson.build b/libnetclient/meson.build
index 1fd5011be..1f57e283d 100644
--- a/libnetclient/meson.build
+++ b/libnetclient/meson.build
@@ -22,7 +22,7 @@ libnetclient_a = static_library('netclient', libnetclient_a_sources,
 if libnetclient_docs
   doxygen = doxygen_program.path()
   dox_path = join_paths(meson.source_root(), meson.current_source_dir(), 'libnetclient.dox')
-  run_command(doxygen, dox_path)
+  run_command(doxygen, dox_path, check : true)
 endif
 
 subdir('test')
diff --git a/libnetclient/test/meson.build b/libnetclient/test/meson.build
index e2192b275..8ddcf29e5 100644
--- a/libnetclient/test/meson.build
+++ b/libnetclient/test/meson.build
@@ -50,17 +50,19 @@ if libnetclient_test
   run_command(valgrind, [valgr_flags,
                          '--suppressions=' + supp_path,
                          '--log-file=' + vg_path,
-                         tests_path])
+                         tests_path],
+              check : true)
 
   # lcov
   # Note: the following hack is needed so lcov recognises the paths of the sources...
   libsrcdir = join_paths(source_path, '..')
   lcov_out_path = join_paths(build_path, 'tests.covi')
-  run_command(lcov, ['-c', '-b', libsrcdir, '-d', source_path, '--no-external', '-o', lcov_out_path])
-  run_command(lcov, ['-r', lcov_out_path, 'tests.c', '-o', lcov_out_path])
+  run_command(lcov, ['-c', '-b', libsrcdir, '-d', source_path, '--no-external', '-o', lcov_out_path],
+              check : true)
+  run_command(lcov, ['-r', lcov_out_path, 'tests.c', '-o', lcov_out_path], check : true)
 
   # genhtml
   html_out_path = join_paths(build_path, 'gcov')
-  run_command(genhtml, [genhtml_flags, '-o', html_out_path, lcov_out_path])
+  run_command(genhtml, [genhtml_flags, '-o', html_out_path, lcov_out_path], check : true)
 
 endif # libnetclient_test
diff --git a/meson.build b/meson.build
index 033bc7092..2b3854a24 100644
--- a/meson.build
+++ b/meson.build
@@ -7,10 +7,11 @@ project('balsa', 'c',
 balsa_version = meson.project_version()
 
 balsa_from_git = run_command('sh', '-c', 'test -d ${MESON_SOURCE_ROOT}/.git',
-                             check: false).returncode() == 0
+                             check : false).returncode() == 0
 
 if balsa_from_git
-  git_describe = run_command('git', 'describe', '--tags')
+  git_describe = run_command('git', 'describe', '--tags',
+                             check : true)
   if git_describe.returncode() == 0
     balsa_version = git_describe.stdout().strip()
   endif
@@ -183,9 +184,9 @@ if html_widget == 'webkit2'
     conf.set_quoted('HTML2TEXT', html2text.path(),
       description : 'Path to html2text program.')
     conftest_htm = join_paths(meson.current_build_dir(), 'conftest.htm')
-    run_command('sh', '-c', 'echo "<html/>" > ' + conftest_htm)
+    run_command('sh', '-c', 'echo "<html/>" > ' + conftest_htm, check : true)
     unicode_snob = run_command(html2text.path(), '--unicode-snob', conftest_htm,
-                               check: false)
+                               check : false)
     if unicode_snob.returncode() == 0
       conf.set('HTML2TEXT_UCOPT', 1,
         description : 'Defined when HTML2TEXT accepts the --unicode-snob option.')
@@ -302,8 +303,8 @@ if gss
   conf.set('HAVE_GSSAPI', 1,
     description : 'Defined when GSSAPI support is to be compiled.')
   krb5_config = krb5_config_program.path()
-  krb5_cflags = run_command(krb5_config, ['--cflags', 'gssapi']).stdout().strip().split()
-  krb5_libs   = run_command(krb5_config, ['--libs',   'gssapi']).stdout().strip().split()
+  krb5_cflags = run_command(krb5_config, ['--cflags', 'gssapi'], check : true).stdout().strip().split()
+  krb5_libs   = run_command(krb5_config, ['--libs',   'gssapi'], check : true).stdout().strip().split()
   if compiler.has_header('gssapi.h')
     conf.set('HAVE_HEIMDAL', 1,
       description : 'Defined for Heimdal.')


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