Allow vs_module_defs to use a custom_target Add a test and update documentationpull/1792/head
parent
abd12b69ea
commit
66a6ea984b
7 changed files with 40 additions and 2 deletions
@ -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) |
@ -0,0 +1,5 @@ |
|||||||
|
int somedllfunc(); |
||||||
|
|
||||||
|
int main(int argc, char **argv) { |
||||||
|
return somedllfunc() == 42 ? 0 : 1; |
||||||
|
} |
@ -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) |
@ -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) |
@ -0,0 +1,3 @@ |
|||||||
|
int somedllfunc() { |
||||||
|
return 42; |
||||||
|
} |
Loading…
Reference in new issue