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 --- .../10 vs module defs generated custom target/meson.build | 10 ++++++++++ .../windows/10 vs module defs generated custom target/prog.c | 5 +++++ .../subdir/make_def.py | 6 ++++++ .../subdir/meson.build | 7 +++++++ .../10 vs module defs generated custom target/subdir/somedll.c | 3 +++ 5 files changed, 31 insertions(+) create mode 100644 meson/test cases/windows/10 vs module defs generated custom target/meson.build create mode 100644 meson/test cases/windows/10 vs module defs generated custom target/prog.c create mode 100755 meson/test cases/windows/10 vs module defs generated custom target/subdir/make_def.py create mode 100644 meson/test cases/windows/10 vs module defs generated custom target/subdir/meson.build create mode 100644 meson/test cases/windows/10 vs module defs generated custom target/subdir/somedll.c (limited to 'meson/test cases/windows/10 vs module defs generated custom target') diff --git a/meson/test cases/windows/10 vs module defs generated custom target/meson.build b/meson/test cases/windows/10 vs module defs generated custom target/meson.build new file mode 100644 index 000000000..fe594c878 --- /dev/null +++ b/meson/test cases/windows/10 vs module defs generated custom target/meson.build @@ -0,0 +1,10 @@ +project('generated_dll_module_defs', 'c') + +if meson.backend().startswith('vs') + # FIXME: Broken on the VS backends + error('MESON_SKIP_TEST see https://github.com/mesonbuild/meson/issues/1799') +endif + +subdir('subdir') +exe = executable('prog', 'prog.c', link_with : shlib) +test('runtest', exe) diff --git a/meson/test cases/windows/10 vs module defs generated custom target/prog.c b/meson/test cases/windows/10 vs module defs generated custom target/prog.c new file mode 100644 index 000000000..066ac227a --- /dev/null +++ b/meson/test cases/windows/10 vs module defs generated custom target/prog.c @@ -0,0 +1,5 @@ +int somedllfunc(void); + +int main(void) { + return somedllfunc() == 42 ? 0 : 1; +} diff --git a/meson/test cases/windows/10 vs module defs generated custom target/subdir/make_def.py b/meson/test cases/windows/10 vs module defs generated custom target/subdir/make_def.py new file mode 100755 index 000000000..50acfb5ef --- /dev/null +++ b/meson/test cases/windows/10 vs module defs generated custom target/subdir/make_def.py @@ -0,0 +1,6 @@ +#!/usr/bin/env python3 +import sys + +with open(sys.argv[1], 'w') as f: + print('EXPORTS', file=f) + print(' somedllfunc', file=f) diff --git a/meson/test cases/windows/10 vs module defs generated custom target/subdir/meson.build b/meson/test cases/windows/10 vs module defs generated custom target/subdir/meson.build new file mode 100644 index 000000000..c4ae33ae4 --- /dev/null +++ b/meson/test cases/windows/10 vs module defs generated custom target/subdir/meson.build @@ -0,0 +1,7 @@ +make_def = find_program('make_def.py') + +def_file = custom_target('gen_def', + command: [make_def, '@OUTPUT@'], + output: 'somedll.def') + +shlib = shared_library('somedll', 'somedll.c', vs_module_defs: def_file) diff --git a/meson/test cases/windows/10 vs module defs generated custom target/subdir/somedll.c b/meson/test cases/windows/10 vs module defs generated custom target/subdir/somedll.c new file mode 100644 index 000000000..f095b1839 --- /dev/null +++ b/meson/test cases/windows/10 vs module defs generated custom target/subdir/somedll.c @@ -0,0 +1,3 @@ +int somedllfunc(void) { + return 42; +} -- cgit 1.2.3-korg