lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 12 Jul 2016, at 3:35 pm, Philipp Janda <siffiejoe@gmx.net> wrote:
> 
> Am 12.07.2016 um 15:00 schröbte Nagaev Boris:
>> On Tue, Jul 12, 2016 at 1:41 PM, Tom Sutcliffe <tomsci@me.com> wrote:
>>> In an ideal world I would build Lua as a DLL, have both the EXE and the extension DLL link against the Lua DLL, then there'd only ever be 1 version of the static data as nature intended.
>> 
>> You can compile Lua twice:
>>   - as DLL and link Lua C modules against that DLL,
>>   - then compile Lua statically as a part of your main executable.
> 
> Well, and the above mentioned DLL should be a proxy DLL. See here[1] (also look at the links at the bottom).

Interesting, thanks! It hadn't occurred to me to go down that route to avoid the duplication of static data in the first place - I'll definitely take a look through the various LuaProxyDlls to see which can be most easily shoehorned into my toolchain :)

Assuming I were to continue down the (increasingly unwise-looking) route of having the extensions also statically linking in lua.lib, rather than using a proxy DLL, does anyone have a view on the validity of passing lua_States between multiple copies of the Lua code? I only ask because my project unfortunately has a rat's nest of dependencies, subprojects and generated build files which might make it quite difficult to make the extension DLLs link against a proxy DLL instead of the lua.lib indirectly used elsewhere. The fun of adding new dependencies into a project whose makefiles/buildscripts/etc are approximately the same size as the entire Lua source...

Cheers,

Tom