|
On Wed, Apr 30, 2014 at 8:58 AM, Igor Trevisan <igt1972@gmail.com> wrote:Yes, this is a common need and there are several ways to solve it.
You can encode the Lua file as a C string and load that; this string
can then be compiled as part of your program. (The Lua compiler is so
fast that generally compiling-as-bytecode is only needed for the most
performance-sensitive applications and/or embedded)
(Writing a Lua file as a C string is a straightforward exercise in Lua)
The Lua file can be attached to your executable, say as a resource (if
Windows) or simply glued to the end of the executable (which is how
srlua works)
If there are multiple files, they can be collected together as a code
archive (see Squish, soar, and others)