From 86928b5c3172bd56db2d591252d1302feb5e8e09 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Mon, 4 Jun 2012 16:23:02 -0700 Subject: [PATCH] disable bson dependency, nobody is using that code --- src/CMakeLists.txt | 2 +- src/bindings/bind_unit.c | 8 +++++++- src/eressea.c | 6 +++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4a0287d56..e187bdc54 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -80,7 +80,7 @@ set (LIB_SRC attributes/raceprefix.c attributes/reduceproduction.c attributes/targetregion.c - bindings/bind_attrib.c +# bindings/bind_attrib.c bindings/bind_building.c bindings/bind_faction.c bindings/bind_gmtool.c diff --git a/src/bindings/bind_unit.c b/src/bindings/bind_unit.c index 8949ddb66..3a016b900 100644 --- a/src/bindings/bind_unit.c +++ b/src/bindings/bind_unit.c @@ -13,7 +13,9 @@ without prior permission by the authors of Eressea. #include #include "bind_unit.h" -#include "bind_attrib.h" +#ifdef BSON_ATTRIB +# include "bind_attrib.h" +#endif #include "bindings.h" /* attributes includes */ @@ -60,6 +62,7 @@ static int tolua_unit_get_objects(lua_State * L) return 1; } +#ifdef BSON_ATTRIB static int tolua_unit_get_attribs(lua_State * L) { unit *self = (unit *) tolua_tousertype(L, 1, 0); @@ -74,6 +77,7 @@ static int tolua_unit_get_attribs(lua_State * L) lua_pushcclosure(L, tolua_attriblist_next, 1); return 1; } +#endif int tolua_unitlist_nextf(lua_State * L) { @@ -979,7 +983,9 @@ void tolua_unit_open(lua_State * L) tolua_variable(L, TOLUA_CAST "hp_max", &tolua_unit_get_hpmax, 0); tolua_variable(L, TOLUA_CAST "objects", &tolua_unit_get_objects, 0); +#ifdef BSON_ATTRIB tolua_variable(L, TOLUA_CAST "attribs", &tolua_unit_get_attribs, 0); +#endif } tolua_endmodule(L); } diff --git a/src/eressea.c b/src/eressea.c index f3620b2a5..50ab01485 100644 --- a/src/eressea.c +++ b/src/eressea.c @@ -13,7 +13,9 @@ #include #include #include -#include +#ifdef BSON_ATTRIB +# include +#endif #include #include #include @@ -99,7 +101,9 @@ static lua_State *lua_init(void) tolua_ship_open(L); tolua_region_open(L); tolua_faction_open(L); +#ifdef BSON_ATTRIB tolua_attrib_open(L); +#endif tolua_unit_open(L); tolua_message_open(L); tolua_hashtable_open(L);