Author: sapient
Date: Mon Mar 23 04:26:17 2009
New Revision: 34061
URL: http://svn.gna.org/viewcvs/wesnoth?rev=34061&view=rev
Log:
add a DISABLE_LUA compile option
Modified:
trunk/SConstruct
trunk/src/scripting/lua.cpp
Modified: trunk/SConstruct
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/SConstruct?rev=34061&r1=34060&r2=34061&view=diff
==============================================================================
--- trunk/SConstruct (original)
+++ trunk/SConstruct Mon Mar 23 04:26:17 2009
@@ -60,6 +60,7 @@
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 @@
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
Modified: trunk/src/scripting/lua.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/scripting/lua.cpp?rev=34061&r1=34060&r2=34061&view=diff
==============================================================================
--- trunk/src/scripting/lua.cpp (original)
+++ trunk/src/scripting/lua.cpp Mon Mar 23 04:26:17 2009
@@ -21,6 +21,16 @@
* of a C++ object with a destructor. This is why this file uses goto-s
* 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>
@@ -700,3 +710,6 @@
lua_remove(L, -1 - nRets);
}
+
+#endif // HAVE LUA
+
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits