add a DISABLE_LUA compile option

This commit is contained in:
Patrick Parker 2009-03-23 03:26:17 +00:00
parent e94dcecf17
commit 996c16d2e8
2 changed files with 17 additions and 0 deletions

View file

@ -60,6 +60,7 @@ opts.AddVariables(
PathVariable('python_site_packages_dir', 'sets the directory where python modules are installed', "lib/python/site-packages/wesnoth", PathVariable.PathAccept),
BoolVariable('editor', 'Enable editor', True),
BoolVariable('lowmem', 'Set to reduce memory usage by removing extra functionality', False),
BoolVariable('lua', 'Enable Lua support', True),
BoolVariable('nls','enable compile/install of gettext message catalogs',True),
PathVariable('prefix', 'autotools-style installation prefix', "/usr/local", PathVariable.PathAccept),
PathVariable('prefsdir', 'user preferences directory', ".wesnoth$version_suffix", PathVariable.PathAccept),
@ -317,6 +318,9 @@ for env in [test_env, env]:
if not env["editor"]:
env.Append(CPPDEFINES = "DISABLE_EDITOR2")
if not env['lua']:
env.Append(CPPDEFINES = "DISABLE_LUA")
if env["PLATFORM"] == "win32":
env["pool_alloc"] = False

View file

@ -22,6 +22,16 @@
* to force object unscoping before erroring out.
*/
#ifdef DISABLE_LUA
#include "scripting/lua.hpp"
LuaKernel::LuaKernel() {std::cerr <<"NOTE: Lua support disabled in this build";}
LuaKernel::~LuaKernel() {}
void LuaKernel::run_event(vconfig const &cfg, game_events::queued_event const &ev,
game_events::event_handler *handler, unit_map *units) {}
void LuaKernel::run(char const *prog) {}
void LuaKernel::execute(char const *prog, int nArgs, int nRets) {}
#else // HAVE LUA
extern "C" {
#include <lualib.h>
#include <lauxlib.h>
@ -700,3 +710,6 @@ void LuaKernel::execute(char const *prog, int nArgs, int nRets)
lua_remove(L, -1 - nRets);
}
#endif // HAVE LUA