From c7a75aa3c24936e9eae57f6cd43cdadf8847bbd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Date: Tue, 2 Aug 2022 13:36:15 +0100 Subject: [PATCH] meson: set variables for each program in build-aux dir MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Daniel P. Berrangé --- build-aux/meson.build | 14 ++++++++++++++ data/meson.build | 4 ++-- meson.build | 10 +++++----- src/meson.build | 3 +-- 4 files changed, 22 insertions(+), 9 deletions(-) create mode 100644 build-aux/meson.build diff --git a/build-aux/meson.build b/build-aux/meson.build new file mode 100644 index 0000000..9b8b788 --- /dev/null +++ b/build-aux/meson.build @@ -0,0 +1,14 @@ + +scripts = [ + 'buildenv.py', + 'dist.py', + 'gen-authors.py', + 'msitool.py', + 'post_install.py', + 'run-windres.py', +] + +foreach name : scripts + sname = name.split('.')[0].underscorify() + set_variable('@0@_prog'.format(sname), find_program(name)) +endforeach diff --git a/data/meson.build b/data/meson.build index 4325108..c978393 100644 --- a/data/meson.build +++ b/data/meson.build @@ -50,7 +50,7 @@ if with_msi output: ['buildenv.txt'], command: [ python3, - join_paths(meson.source_root(), 'build-aux', 'buildenv.py') + buildenv_prog, ], capture: true) @@ -93,7 +93,7 @@ if with_msi build_by_default: false, command: [ python3, - join_paths(meson.source_root(), 'build-aux', 'msitool.py'), + msitool_prog, meson.build_root(), prefix, wixl_arch, diff --git a/meson.build b/meson.build index 51c9513..e169875 100644 --- a/meson.build +++ b/meson.build @@ -508,9 +508,10 @@ configure_file( configuration: conf_data ) +subdir('build-aux') + if git - authors_helper = join_paths(meson.source_root(), 'build-aux', 'gen-authors.py') - authors = run_command(python3.path(), authors_helper, env: runutf8) + authors = run_command(python3.path(), gen_authors_prog, env: runutf8) authors_file = 'AUTHORS.in' authors_conf = configuration_data() @@ -534,9 +535,8 @@ if git configuration: conf_data ) - dist_helper = join_paths(meson.source_root(), 'build-aux', 'dist.py') - meson.add_dist_script(python3.path(), dist_helper, meson.build_root(), 'AUTHORS') - meson.add_dist_script(python3.path(), dist_helper, meson.build_root(), 'virt-viewer.spec') + meson.add_dist_script(python3.path(), dist_prog, meson.build_root(), 'AUTHORS') + meson.add_dist_script(python3.path(), dist_prog, meson.build_root(), 'virt-viewer.spec') endif gnome = import('gnome') diff --git a/src/meson.build b/src/meson.build index 8bf1372..bd5d544 100644 --- a/src/meson.build +++ b/src/meson.build @@ -174,7 +174,6 @@ executable( if host_machine.system() == 'windows' windres = find_program('windres') - runwindres = join_paths(meson.source_root(), 'build-aux', 'run-windres.py') rcfile = configure_file( input: 'virt-viewer.rc.in', @@ -188,7 +187,7 @@ if host_machine.system() == 'windows' output: ['virt-viewer-rc.o'], command : [ python3, - runwindres, + run_windres_prog, windres, join_paths(meson.build_root(), 'icons'), meson.current_source_dir(),