From 2249c797015f780e194ede8bb8b995c6ebf8f0dd Mon Sep 17 00:00:00 2001 From: bilhox <69472620+bilhox@users.noreply.github.com> Date: Mon, 14 Oct 2024 12:05:11 +0200 Subject: [PATCH 1/2] try except --- meson.build | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index dcaeb92fb7..3e7f79060b 100644 --- a/meson.build +++ b/meson.build @@ -195,7 +195,11 @@ if plat == 'win' and host_machine.cpu_family().startswith('x86') ) # put dlls in root of install - install_data(dlls, install_dir: pg_dir, install_tag: 'pg-tag') + try + install_data(dlls, install_dir: pg_dir, install_tag: 'pg-tag') + catch(e) + error(e.message + '\n' + 'Please try to delete "prebuilt_downloads/", "prebuilt-x64/" and "prebuilt-x86/" directories and retry the installation.') + endtry else bases = ['/usr/local', '/usr', '/opt/homebrew', '/opt/local'] foreach inc_dir : bases From 7462c774e3234d1a69abbae2b2a72a87927e407d Mon Sep 17 00:00:00 2001 From: bilhox <69472620+bilhox@users.noreply.github.com> Date: Wed, 16 Oct 2024 12:58:47 +0200 Subject: [PATCH 2/2] proper meson error when problem of version --- meson.build | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/meson.build b/meson.build index 3e7f79060b..8a62fa1ba9 100644 --- a/meson.build +++ b/meson.build @@ -194,12 +194,18 @@ if plat == 'win' and host_machine.cpu_family().startswith('x86') check: true, ) + foreach lib : dlls + if not fs.exists(lib) + error(f''' + File "@lib@" does not exist. + Please try to delete "prebuilt_downloads/", "prebuilt-x64/" and "prebuilt-x86/" directories, and retry the installation. + ''') + endif + endforeach + # put dlls in root of install - try - install_data(dlls, install_dir: pg_dir, install_tag: 'pg-tag') - catch(e) - error(e.message + '\n' + 'Please try to delete "prebuilt_downloads/", "prebuilt-x64/" and "prebuilt-x86/" directories and retry the installation.') - endtry + install_data(dlls, install_dir: pg_dir, install_tag: 'pg-tag') + else bases = ['/usr/local', '/usr', '/opt/homebrew', '/opt/local'] foreach inc_dir : bases