diff --git a/src/gui/lua/Makefile.am b/src/gui/lua/Makefile.am index f4052960f..5846d094c 100644 --- a/src/gui/lua/Makefile.am +++ b/src/gui/lua/Makefile.am @@ -45,3 +45,19 @@ libneutrino_gui_lua_a_SOURCES = \ lua_threads_copy.cpp \ lua_threads_functions.cpp \ lua_video.cpp + +# the continuous changes of LUA_API_VERSION_* in luainstance.h +# are not only of questionable usefulness, but they also cause +# rebuilds all over the place, even though it is only used in +# 2(!) source files. So split out those two definitions into an +# autogenerated separate file, they are #if 0'ed in luainstance.h +# already and the rest is dealt with via ccache... +BUILT_SOURCES = lua_api_version.h +lua_api_version.h: luainstance.h + @rm -f $@ + grep '^#define.*LUA_API' $(srcdir)/luainstance.h > $@ + +noinst_HEADERS = lua_api_version.h + +# so that lua_api_version.h can be found... +AM_CPPFLAGS += -I$(builddir) diff --git a/src/gui/lua/lua_misc.cpp b/src/gui/lua/lua_misc.cpp index a1e8be916..2c173fe0f 100644 --- a/src/gui/lua/lua_misc.cpp +++ b/src/gui/lua/lua_misc.cpp @@ -36,6 +36,9 @@ #include "luainstance.h" #include "lua_misc.h" +/* autogenerated from luainstance.h */ +#include "lua_api_version.h" + extern CVolume* g_volume; CLuaInstMisc* CLuaInstMisc::getInstance() diff --git a/src/gui/lua/luainstance.cpp b/src/gui/lua/luainstance.cpp index 8c189dbdd..177cca979 100644 --- a/src/gui/lua/luainstance.cpp +++ b/src/gui/lua/luainstance.cpp @@ -49,6 +49,9 @@ #include "lua_threads.h" #include "lua_video.h" +/* autogenerated from luainstance.h */ +#include "lua_api_version.h" + extern CPictureViewer * g_PicViewer; extern cVideo * videoDecoder; diff --git a/src/gui/lua/luainstance.h b/src/gui/lua/luainstance.h index 4d6ff9980..7f0510e05 100644 --- a/src/gui/lua/luainstance.h +++ b/src/gui/lua/luainstance.h @@ -31,8 +31,10 @@ extern "C" { #include "luainstance_helpers.h" +#if 0 #define LUA_API_VERSION_MAJOR 1 #define LUA_API_VERSION_MINOR 35 +#endif void LuaInstRegisterFunctions(lua_State *L, bool fromThreads=false);