[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Compiling LPeg on Windows
- From: "RJP Computing" <rjpcomputing@...>
- Date: Mon, 21 May 2007 14:08:24 -0400
On 5/21/07, Bradley Smith <gmane@baysmith.com> wrote:
Alternatively, you can use premake from http://premake.sourceforge.net/.
With the premake.lua file listed below, run "premake --target vs2005",
and use the lpeg.sln
generated.
Rather than creating a .def file, I just put the following at the top of
the lpeg.c file:
#ifdef _WIN32
__declspec(dllexport) int luaopen_lpeg (lua_State *L);
#endif
----- premake.lua
-----
project.name = "lpeg"
package.name = "lpeg"
package.kind = "dll"
package.language = "c"
package.files = { "lpeg.c" }
if windows then
package.includepaths = { "C:/lua/include" }
package.libpaths = { "C:/lua" }
package.linkoptions = { "/NODEFAULTLIB:LIBCMT" }
package.links = { "lua5.1" }
elseif linux then
package.includepaths = { "/usr/include" }
package.libpaths = { "/usr/lib" }
package.linkoptions = { }
package.links
= { "lua" }
end
package.objdir = "obj"
package.targetprefix = ""
Very nice approach. Premake is great. I use it all the time. Thanks for pointing users to it.
--
Regards,
Ryan
RJP Computing