tags:

views:

211

answers:

2

I've found a couple of questions about embedding Ruby in a C++ app. Almost all of the top-voted answers suggest using Lua instead.

Given that a project I have in mind would be better served by the grammar already expressed in Rake (it's a rules engine), is there any easy way to embed Rake in a C++ app, or is there a Rake-like module for Lua?

To clarify: I want this to be a self-contained app, if possible. It should have minimal pre-requisites, because it'll be running on a fairly bare-boned (Windows) OS.

+1  A: 

There are at least two different projects called "Lua Make" (which you can Google for), and there is also some sort of build system associated with Lua Rocks. It's not clear if the Lua Rocks thing will be of any use, but the other two appear to be worth checking out.

Norman Ramsey
+1  A: 

There are a number of build systems that can use Lua, based strongly on Lua or even implemented in Lua. Some of them are listed at the Lua User's Wiki.

Of the ones listed at the wiki, Bou was explicitly inspired by Rake. Its author observed that the name "lake" was already in use for another build system, but didn't provide a link so I have no clue what that one might have been related to.

The "official" binary releases of Lua all come from a system called tecmake originated at Tecgraf like Lua itself. Tecmake is implemented on top of make, via a wrapping shell script and a common set of Makefile rules implementing its conventions. It works well for them, but personally I've never been able to get it to run on my system.

LuaRocks uses Lua to describe build requirements, is written almost entirely in Lua, and is intended to be integrated with a distributed application so that applications can be self-updating. I don't know how easy it would be to leverage its build engine for other purposes, but I'm sure it could be done.

RBerteig