Merge: nitc: intro hidden option to compile to a shared native lib (.so/.dll)
authorJean Privat <jean@pryen.org>
Fri, 8 Jun 2018 22:42:35 +0000 (18:42 -0400)
committerJean Privat <jean@pryen.org>
Fri, 8 Jun 2018 22:42:35 +0000 (18:42 -0400)
commitcc1fcfe745f33e19a7bfc4f4e69881d94bd7f458
tree67cd5452d0585b462ea94d82cc9fcff06342b6ce
parentcc82ab7db09e689a51590cc103c16f7034759f8d
parentcfed3fc300802b136dc8f91d43ef9044392818b3
Merge: nitc: intro hidden option to compile to a shared native lib (.so/.dll)

Add the `--shared-lib` command line option for `nitc` to generate a native library (.so or .dll). It is hidden because by itself it is not very useful. This is a first step to create polyglot programs where Nit is not the entrypoing.

I currently use such a DLL by first calling `nit_main` and then invoking callbacks generated by the FFI for a dummy method. Once we have a better way to generate the callbacks (or entrypoint actually) and maybe generate a .h, we could make this an official feature.

Pull-Request: #2714
Reviewed-by: Jean Privat <jean@pryen.org>
src/compiler/abstract_compiler.nit