diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2016-12-03 16:11:34 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2016-12-03 16:11:34 +0200 |
commit | a5dcb89410973f4bfa872cd58616272355638963 (patch) | |
tree | 086f5cd6b8e80613f25bb81eb3d48a5b8ac5d6b7 | |
parent | 49e0676ba932c3b4b9f7de290afc6d7b0d2d6b4c (diff) | |
download | meson-a5dcb89410973f4bfa872cd58616272355638963.zip meson-a5dcb89410973f4bfa872cd58616272355638963.tar.gz meson-a5dcb89410973f4bfa872cd58616272355638963.tar.bz2 |
Link against runtime on OSX and Windows because they seem to insist on all symbols being present.
-rw-r--r-- | test cases/common/125 shared module/meson.build | 13 | ||||
-rw-r--r-- | test cases/common/125 shared module/runtime.c | 2 |
2 files changed, 13 insertions, 2 deletions
diff --git a/test cases/common/125 shared module/meson.build b/test cases/common/125 shared module/meson.build index 5ca50c5..44abf55 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 f701171..68c813a 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; } |