From af1a266670d040d2f4083ff309d732d648afba2a Mon Sep 17 00:00:00 2001 From: Angelos Mouzakitis Date: Tue, 10 Oct 2023 14:33:42 +0000 Subject: Add submodule dependency files Change-Id: Iaf8d18082d3991dec7c0ebbea540f092188eb4ec --- .../common/242 custom target feed/meson.build | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 meson/test cases/common/242 custom target feed/meson.build (limited to 'meson/test cases/common/242 custom target feed/meson.build') diff --git a/meson/test cases/common/242 custom target feed/meson.build b/meson/test cases/common/242 custom target feed/meson.build new file mode 100644 index 000000000..1cda37d75 --- /dev/null +++ b/meson/test cases/common/242 custom target feed/meson.build @@ -0,0 +1,24 @@ +project('custom target feed', 'c') + +python3 = import('python3').find_python() + +# Note that this will not add a dependency to the compiler executable. +# Code will not be rebuilt if it changes. +comp = '@0@/@1@'.format(meson.current_source_dir(), 'my_compiler.py') + +mytarget = custom_target('bindat', + output : 'data.dat', + input : 'data_source.txt', + feed : true, + command : [python3, comp, '@OUTPUT@'], + install : true, + install_dir : 'subdir' +) + +ct_output_exists = '''import os, sys +if not os.path.exists(sys.argv[1]): + print("could not find {!r} in {!r}".format(sys.argv[1], os.getcwd())) + sys.exit(1) +''' + +test('capture-wrote', python3, args : ['-c', ct_output_exists, mytarget]) -- cgit 1.2.3-korg