From 46296731616a101ea555edbb9d8b0f5ecd81d009 Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Wed, 8 Feb 2023 15:14:26 +0100 Subject: [PATCH] Don't use `check` keyword argument on old meson. Ubuntu bionic still use meson 0.45.1. On bionic we don't check if the command is successful or not but we don't have choice, the feature is not there. --- static/meson.build | 44 +++++++++++++++++++++++++++++++++----------- 1 file changed, 33 insertions(+), 11 deletions(-) diff --git a/static/meson.build b/static/meson.build index a9f9099be..b650cabcd 100644 --- a/static/meson.build +++ b/static/meson.build @@ -1,8 +1,18 @@ -resource_files = run_command(res_manager, - '--list-all', - files('resources_list.txt'), - check: true - ).stdout().strip().split('\n') +if meson.version().version_compare('>=0.47.0') + resource_files = run_command( + res_manager, + '--list-all', + files('resources_list.txt'), + check: true + ).stdout().strip().split('\n') +else + resource_files = run_command( + res_manager, + '--list-all', + files('resources_list.txt') + ).stdout().strip().split('\n') +endif + preprocessed_resources = custom_target('preprocessed_resource_files', input: 'resources_list.txt', @@ -31,12 +41,24 @@ lib_resources = custom_target('resources', # i18n_resource_files = fs.read('i18n_resources_list.txt').strip().split('\n') # ``` # once we move to meson >= 0.57.0 -i18n_resource_files = run_command(find_program('python3'), - '-c', - 'import sys; f=open(sys.argv[1]); print(f.read())', - files('i18n_resources_list.txt'), - check: true - ).stdout().strip().split('\n') + +if meson.version().version_compare('>=0.47.0') + i18n_resource_files = run_command( + find_program('python3'), + '-c', + 'import sys; f=open(sys.argv[1]); print(f.read())', + files('i18n_resources_list.txt'), + check: true + ).stdout().strip().split('\n') +else + i18n_resource_files = run_command( + find_program('python3'), + '-c', + 'import sys; f=open(sys.argv[1]); print(f.read())', + files('i18n_resources_list.txt'), + ).stdout().strip().split('\n') +endif + i18n_resources = custom_target('i18n_resources', input: i18n_resource_files,