diff options
author | Angelos Mouzakitis <a.mouzakitis@virtualopensystems.com> | 2023-10-10 14:33:42 +0000 |
---|---|---|
committer | Angelos Mouzakitis <a.mouzakitis@virtualopensystems.com> | 2023-10-10 14:33:42 +0000 |
commit | af1a266670d040d2f4083ff309d732d648afba2a (patch) | |
tree | 2fc46203448ddcc6f81546d379abfaeb323575e9 /meson/test cases/windows/10 vs module defs generated custom target | |
parent | e02cda008591317b1625707ff8e115a4841aa889 (diff) |
Change-Id: Iaf8d18082d3991dec7c0ebbea540f092188eb4ec
Diffstat (limited to 'meson/test cases/windows/10 vs module defs generated custom target')
5 files changed, 31 insertions, 0 deletions
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; +} |