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/13 pch/generated/gen_custom.py | 5 +++++ .../common/13 pch/generated/gen_generator.py | 7 +++++++ .../common/13 pch/generated/generated_generator.in | 1 + .../test cases/common/13 pch/generated/meson.build | 22 ++++++++++++++++++++++ .../test cases/common/13 pch/generated/pch/prog.h | 2 ++ meson/test cases/common/13 pch/generated/prog.c | 6 ++++++ 6 files changed, 43 insertions(+) create mode 100644 meson/test cases/common/13 pch/generated/gen_custom.py create mode 100644 meson/test cases/common/13 pch/generated/gen_generator.py create mode 100644 meson/test cases/common/13 pch/generated/generated_generator.in create mode 100644 meson/test cases/common/13 pch/generated/meson.build create mode 100644 meson/test cases/common/13 pch/generated/pch/prog.h create mode 100644 meson/test cases/common/13 pch/generated/prog.c (limited to 'meson/test cases/common/13 pch/generated') diff --git a/meson/test cases/common/13 pch/generated/gen_custom.py b/meson/test cases/common/13 pch/generated/gen_custom.py new file mode 100644 index 000000000..650e03c2b --- /dev/null +++ b/meson/test cases/common/13 pch/generated/gen_custom.py @@ -0,0 +1,5 @@ +#!/usr/bin/env python3 +import sys + +with open(sys.argv[1], 'w') as f: + f.write("#define FOO 0") diff --git a/meson/test cases/common/13 pch/generated/gen_generator.py b/meson/test cases/common/13 pch/generated/gen_generator.py new file mode 100644 index 000000000..a245e7aef --- /dev/null +++ b/meson/test cases/common/13 pch/generated/gen_generator.py @@ -0,0 +1,7 @@ +#!/usr/bin/env python3 +import sys + +with open(sys.argv[1]) as f: + content = f.read() +with open(sys.argv[2], 'w') as f: + f.write(content) diff --git a/meson/test cases/common/13 pch/generated/generated_generator.in b/meson/test cases/common/13 pch/generated/generated_generator.in new file mode 100644 index 000000000..1a00ebd21 --- /dev/null +++ b/meson/test cases/common/13 pch/generated/generated_generator.in @@ -0,0 +1 @@ +#define BAR 0 diff --git a/meson/test cases/common/13 pch/generated/meson.build b/meson/test cases/common/13 pch/generated/meson.build new file mode 100644 index 000000000..ba06bcea8 --- /dev/null +++ b/meson/test cases/common/13 pch/generated/meson.build @@ -0,0 +1,22 @@ +cc = meson.get_compiler('c') +cc_id = cc.get_id() + +if cc_id == 'lcc' + error('MESON_SKIP_TEST: Elbrus compiler does not support PCH.') +endif + +# PGI compiler only supports PCH for C++ +if cc_id == 'pgi' + subdir_done() +endif + +generated_customTarget = custom_target('makeheader', + output: 'generated_customTarget.h', + command : [find_program('gen_custom.py'), '@OUTPUT0@']) + +generated_generator = generator(find_program('gen_generator.py'), + output: '@BASENAME@.h', + arguments: ['@INPUT@', '@OUTPUT@']) + +exe = executable('prog', 'prog.c', generated_customTarget, generated_generator.process('generated_generator.in'), + c_pch: 'pch/prog.h') diff --git a/meson/test cases/common/13 pch/generated/pch/prog.h b/meson/test cases/common/13 pch/generated/pch/prog.h new file mode 100644 index 000000000..15fec38ce --- /dev/null +++ b/meson/test cases/common/13 pch/generated/pch/prog.h @@ -0,0 +1,2 @@ +#include "generated_customTarget.h" +#include "generated_generator.h" diff --git a/meson/test cases/common/13 pch/generated/prog.c b/meson/test cases/common/13 pch/generated/prog.c new file mode 100644 index 000000000..6765ac102 --- /dev/null +++ b/meson/test cases/common/13 pch/generated/prog.c @@ -0,0 +1,6 @@ +// No includes here, they need to come from the PCH + +int main(void) { + return FOO + BAR; +} + -- cgit 1.2.3-korg