Allow using generated files to shared_library vs_module_defs. Closes #1605
This detects and allows passing a generated file as a vs_module_def, it also adds a testcase that tests using configure_file to generate the .def file.pull/1606/head
parent
7d5e4012fe
commit
c49f5aefd8
6 changed files with 40 additions and 6 deletions
@ -0,0 +1,7 @@ |
||||
project('generated_dll_module_defs', 'c') |
||||
|
||||
if meson.get_compiler('c').get_id() == 'msvc' |
||||
subdir('subdir') |
||||
exe = executable('prog', 'prog.c', link_with : shlib) |
||||
test('runtest', exe) |
||||
endif |
@ -0,0 +1,5 @@ |
||||
int somedllfunc(); |
||||
|
||||
int main(int argc, char **argv) { |
||||
return somedllfunc() == 42 ? 0 : 1; |
||||
} |
@ -0,0 +1,9 @@ |
||||
conf = configuration_data() |
||||
conf.set('func', 'somedllfunc') |
||||
def_file = configure_file( |
||||
input: 'somedll.def.in', |
||||
output: 'somedll.def', |
||||
configuration : conf, |
||||
) |
||||
|
||||
shlib = shared_library('somedll', 'somedll.c', vs_module_defs : def_file) |
@ -0,0 +1,5 @@ |
||||
#ifdef _MSC_VER |
||||
int somedllfunc() { |
||||
return 42; |
||||
} |
||||
#endif |
@ -0,0 +1,2 @@ |
||||
EXPORTS |
||||
@func@ |
Loading…
Reference in new issue