From 5b99177dad55fb322417b648abb805dadea70657 Mon Sep 17 00:00:00 2001 From: Jehan Date: Thu, 15 Aug 2024 19:26:00 +0200 Subject: [PATCH] meson: shortcut meson not finding gimp-data/meson.build with a better error message. As reported by pippin, when gimp-data submodule is not initialized, meson configuration fails with: > meson.build:1830:0: ERROR: Nonexistent build file 'gimp-data/meson.build' This does not give a lot of info, and while the solution can also be found in INSTALL.in (INSTALL in tarballs) and on developer website, it's nicer if the build itself could give a clearer information. Now it will say instead: > ERROR: Problem encountered: gimp-data submodule not present. Run: git submodule update --init --- meson.build | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/meson.build b/meson.build index 83e13648b2..4e7bf82586 100644 --- a/meson.build +++ b/meson.build @@ -1721,6 +1721,16 @@ if is_git_repository ) endif +if is_git_repository + has_gimp_data = run_command(python, '-c', + 'import sys,os; sys.exit(0 if os.path.exists("gimp-data/meson.build") else 1)', + check: false + ).returncode() == 0 + + if not has_gimp_data + error('gimp-data submodule not present. Run: git submodule update --init') + endif +endif configure_file( output: 'config.h',