[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Cross-platform way to compile a Lua module written in C
- From: Dibyendu Majumdar <mobile@...>
- Date: Wed, 21 Jul 2021 11:33:23 +0100
On Mon, 19 Jul 2021 at 16:20, Hugo Musso Gualandi
> Does anyone know if there is some tool that I can use to compile a ".c"
> Lua module to a dynamic library (".so" or ".dll), with all the
> appropriate compilation flags for the operating system?
> My motivation is that I would like to make the Pallene compiler more
> portable. Pallene uses C as a compilation target and then compiles
> those C modules into dynamic libraries that can be "required" from Lua.
> Currently we have some Linux-specific code for invoking the C compiler
> to build the final ".so". I would love to replace it with an external
> tool that also knows how to build shared libraries on other operating
I have similar requirement for Ravi when compiling AOT.
I think though that vast majority of scenarios will be covered by
clang, gcc, and MSVC.
And typically all I need is to compile a single C source to
corresponding dynamic library.
I think it can be a simple Lua script that know the options for the
commonly used C compilers; I would suggest avoiding heavyweight
solutions that are being proposed. I am not aware of an existing