diff --git a/test cases/common/125 shared module/meson.build b/test cases/common/125 shared module/meson.build index 5ca50c5e2..44abf55ee 100644 --- a/test cases/common/125 shared module/meson.build +++ b/test cases/common/125 shared module/meson.build @@ -2,7 +2,18 @@ project('shared module', 'c') dl = meson.get_compiler('c').find_library('dl', required : false) l = shared_library('runtime', 'runtime.c') -m = shared_module('mymodule', 'module.c') +if host_machine.system() == 'darwin' or host_machine.system() == 'windows' + # At least in OSX and seemingly also on Windows you must have + # all symbols present when linking a module. + # + # In Linux many projects build plugins without linking to + # the runtime so they have undefined symbols. We need to support + # both for ease of transitioning. + mlink = [l] +else + mlink = [] +endif +m = shared_module('mymodule', 'module.c', link_with : mlink) e = executable('prog', 'prog.c', link_with : l, dependencies : dl) test('import test', e, args : [m.full_path()]) diff --git a/test cases/common/125 shared module/runtime.c b/test cases/common/125 shared module/runtime.c index f701171fd..68c813a4d 100644 --- a/test cases/common/125 shared module/runtime.c +++ b/test cases/common/125 shared module/runtime.c @@ -14,6 +14,6 @@ * modules. */ -int func_from_language_runtime() { +int DLL_PUBLIC func_from_language_runtime() { return 86; }