Link against runtime on OSX and Windows because they seem to insist on all symbols being present.

pull/1126/head
Jussi Pakkanen 8 years ago
parent 49e0676ba9
commit a5dcb89410
  1. 13
      test cases/common/125 shared module/meson.build
  2. 2
      test cases/common/125 shared module/runtime.c

@ -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()])

@ -14,6 +14,6 @@
* modules.
*/
int func_from_language_runtime() {
int DLL_PUBLIC func_from_language_runtime() {
return 86;
}

Loading…
Cancel
Save