[recipes] Fix dependencies for generated sources



commit ae2fe675b2090e38d24a2ec2286b7d173e7aade4
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Apr 10 21:44:11 2017 -0400

    Fix dependencies for generated sources
    
    This patch was suggested by Tim-Philipp Müller,
    and seems to work in a quick test.

 src/meson.build   |   12 ++++++++----
 tests/meson.build |    2 +-
 2 files changed, 9 insertions(+), 5 deletions(-)
---
diff --git a/src/meson.build b/src/meson.build
index 4b0fa78..42296dc 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -1,4 +1,5 @@
 src = []
+src_incs = []
 enums = []
 
 # These generated files are #included
@@ -6,11 +7,14 @@ list_to_c = find_program('list_to_c.py')
 foreach f : ['segments', 'ingredients']
   ofile = f + '.inc'
   ifile = files('../data/' + f + '.list')
-  src += [custom_target(f,
-                        output : ofile,
-                        input : ifile,
-                        command : [list_to_c, '@INPUT@', '@OUTPUT@', ''])]
+  src_incs += [custom_target(f,
+                             output : ofile,
+                             input : ifile,
+                             command : [list_to_c, '@INPUT@', '@OUTPUT@', ''])]
 endforeach
+
+src += src_incs
+
 ofile = 'no-ingredients.inc'
 ifile = files('../data/ingredients.list')
 src += [custom_target('no-ingredients',
diff --git a/tests/meson.build b/tests/meson.build
index b484f6e..4da7f76 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -7,7 +7,7 @@ env.set('MALLOC_CHECK_', '2')
 # FIXME: Add a meson helper to get a random number
 env.set('MALLOC_PERTURB_', '113') # Guaranteed random!
 
-ingredients = executable('ingredients', 'ingredients-test.c',
+ingredients = executable('ingredients', 'ingredients-test.c', src_incs,
                          include_directories : tests_inc,
                          dependencies: deps)
 test('ingredients', ingredients, env : env)


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