diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-29 04:41:38 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-29 04:41:38 +0000 |
commit | 7b6e527f440cd7e6f8be2b07cee320ee6ca18786 (patch) | |
tree | 4a2738d69fa2814659fdadddf5826282e73d81f4 /test cases/vala/24 export dynamic shared module | |
parent | Initial commit. (diff) | |
download | meson-7b6e527f440cd7e6f8be2b07cee320ee6ca18786.tar.xz meson-7b6e527f440cd7e6f8be2b07cee320ee6ca18786.zip |
Adding upstream version 1.0.1.upstream/1.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test cases/vala/24 export dynamic shared module')
3 files changed, 44 insertions, 0 deletions
diff --git a/test cases/vala/24 export dynamic shared module/app.vala b/test cases/vala/24 export dynamic shared module/app.vala new file mode 100644 index 0000000..e016ecd --- /dev/null +++ b/test cases/vala/24 export dynamic shared module/app.vala @@ -0,0 +1,21 @@ +const string MODULE_LIB = "libapp_module.so"; + +delegate int ModuleFunc (); + +public int app_func () { + return 41; +} + +int main () { + Module module; + void *func; + unowned ModuleFunc mfunc; + + module = Module.open (MODULE_LIB, ModuleFlags.BIND_LAZY); + module.symbol ("module_func", out func); + mfunc = (ModuleFunc) func; + + print ("%d\n", mfunc ()); + + return 0; +} diff --git a/test cases/vala/24 export dynamic shared module/meson.build b/test cases/vala/24 export dynamic shared module/meson.build new file mode 100644 index 0000000..9aa9fd9 --- /dev/null +++ b/test cases/vala/24 export dynamic shared module/meson.build @@ -0,0 +1,20 @@ +project ('test', ['c', 'vala'], version: '0.1') + +deps = [ + dependency ('glib-2.0'), + dependency ('gmodule-2.0'), +] + +app = executable ( + 'app', + ['app.vala'], + dependencies: deps, + export_dynamic: true +) + +shared_module ( + 'app_module', + ['module.vala'], + link_with: app, + dependencies : deps, +) diff --git a/test cases/vala/24 export dynamic shared module/module.vala b/test cases/vala/24 export dynamic shared module/module.vala new file mode 100644 index 0000000..5553727 --- /dev/null +++ b/test cases/vala/24 export dynamic shared module/module.vala @@ -0,0 +1,3 @@ +public int module_func () { + return app_func() + 1; +} |