[gimp] build, meson: Fix rc files build order dependency...



commit 2afa019c708869ef84a2d24c96552b380a504d4d
Author: Stanislav Grinkov <43956-stanislavgrinkov users noreply gitlab gnome org>
Date:   Wed Sep 29 00:30:25 2021 +0600

    build, meson: Fix rc files build order dependency...
    
    by adding special filler custom_target() build rules.
    
    Basically, these build rules do nothing (a mere meson --version call),
    but they ensure that `git-version.h` is built first, before the dependant
    rc files are used in respective resource compiler build targets.
    
    This still a nasty trick (not a proper solution), but it do the job.
    
    See #6257 for additional information.

 build/windows/meson.build | 28 ++++++++++++++++++++++++++--
 1 file changed, 26 insertions(+), 2 deletions(-)
---
diff --git a/build/windows/meson.build b/build/windows/meson.build
index 28362f6e10..4ec187e3e5 100644
--- a/build/windows/meson.build
+++ b/build/windows/meson.build
@@ -1,13 +1,37 @@
 # Windows specific
 
-gimp_plugins_rc = configure_file(
+configure_file(
   input : 'gimp-plug-ins.rc.in',
   output: 'gimp-plug-ins.rc',
   configuration: versionconfig,
 )
 
-gimp_app_rc = configure_file(
+configure_file(
   input : 'gimp.rc.in',
   output: 'gimp.rc',
   configuration: versionconfig,
 )
+
+# Basically, the build rules below do nothing (a mere `meson --version` call).
+# But because they depends on `git-version.h`, meson ensure that it gets built first,
+# Then the result of this targets is used in 35+ resource compiler build rules.
+#
+# Nasty trick indeed, but it fixes race condition issue described in GNOME/GIMP#6257.
+
+meson_command = find_program('meson')
+
+gimp_plugins_rc = custom_target('git-version.h build-time-dependency for gimp_plugins_rc',
+  build_by_default: true,
+  build_always_stale: true,
+  command: [meson_command, '--version'],
+  depends: [gitversion_h],
+  output:  ['gimp-plug-ins.rc']
+).full_path()
+
+gimp_app_rc = custom_target('git-version.h build-time-dependency for gimp.rc',
+  build_by_default: true,
+  build_always_stale: true,
+  command: [meson_command, '--version'],
+  depends: [gitversion_h],
+  output:  ['gimp.rc']
+).full_path()


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