lua-users home
lua-l archive

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


Jerome Vuarand wrote:
2009/12/3 Javier Guerra <javier@guerrag.com>:
...

Thanks to the "all-in-one" loader, you can put Foo.Bar.core
(luaopen_Foo_Bar_core) in Foo.dll. The C code will be loaded in memory
with the Foo module, but it won't be loaded into the Lua interpreter
until you require Foo.Bar.core.


Thanks both. I ended doing what Javier suggested, but I just tested this suggestion and it works fine. Sadly, it does not work under LuaRocks (at least v1), because I can't find a way to declare that in the rockspec (that's way I'm crossposting this to LR list)

This is the relevant part of the rockspec.

build = {
  type = "command",
  build_command = [[ a command for building my library ]],
  install = {
    lib = {
      ["Foo"] = [[Foo.dll]],
    },
    lua = {
      ["Foo.Bar"] = [[Lua\Bar.lua]]
    }
  }
}

I can't find a way to let LR know that Foo.dll is responsible for modules "Foo" and "Foo.Bar.Core"

Regards,
Ignacio Burgueño