From 33f867270a5040f975a7356be2902e913db611df Mon Sep 17 00:00:00 2001 From: Mauro Iazzi Date: Fri, 30 May 2008 14:24:27 +0200 Subject: [PATCH] build script creates a half-working project file --- build.lua | 30 ++++++++++++++++++++++++++---- common/lqt_common.cpp | 4 ++++ common/lqt_common.hpp | 2 ++ 3 files changed, 32 insertions(+), 4 deletions(-) diff --git a/build.lua b/build.lua index 0b183cb..57f4123 100644 --- a/build.lua +++ b/build.lua @@ -34,11 +34,12 @@ modules = { Module = function(name) local m = modules[name] - local ret = { name = name, } + local ret = { name = name, hppfiles={}, } local deps = {} for _, d in ipairs(m.depends) do table.insert(deps, Module(d)) - table.insert(m.types,d..'_src/'..d..'_type.lua') + table.insert(ret.hppfiles, d..'_head.hpp') + table.insert(m.types, d..'_src/'..d..'_type.lua') end for k, t in pairs(generator.default) do local set = {} @@ -58,6 +59,19 @@ Module = function(name) return ret end +qmake_project = function(n, ...) + return string.gsub([[ +TEMPLATE = lib +TARGET = LQT_MODULE +DEPENDPATH += . +INCLUDEPATH += . ]]..table.concat({...}, ' ')..[[ + +# Input +HEADERS += LQT_MODULE_head.hpp +SOURCES += LQT_MODULE_enum.cpp LQT_MODULE_meta.cpp LQT_MODULE_virt.cpp +]], 'LQT_MODULE', n) +end + compile = function(name) local m = Module(name) -- create stub file @@ -86,14 +100,22 @@ compile = function(name) for _, i in ipairs(m.includes) do cmd = cmd .. '-i \'' .. i .. '\' ' end + for _, h in ipairs(m.hppfiles) do + cmd = cmd .. '-i \'<' .. h .. '>\' ' + end for _, f in ipairs(m.filters) do cmd = cmd .. '-f \'' .. f .. '\' ' end cmd = cmd .. '-n ' .. m.name .. ' ' .. generator.directory..'/'..m.name..'.xml' debug('executing', cmd) os.execute(cmd) + debug('writing project file') + local qmake = qmake_project(name) + local f = io.open(name..'_src/'..name..'.pro', 'w') + f:write(qmake) + f:close() end ---compile'qtcore' -compile'basegui' + +compile(tostring(... or 'qtcore')) diff --git a/common/lqt_common.cpp b/common/lqt_common.cpp index 7403021..921842d 100644 --- a/common/lqt_common.cpp +++ b/common/lqt_common.cpp @@ -448,6 +448,10 @@ void lqtL_pushflags (lua_State *L, int index, const char *name) { return; } +extern "C" int luaopen_qtbase (lua_State *) { + return 0; +} + diff --git a/common/lqt_common.hpp b/common/lqt_common.hpp index f0e9445..7e6f384 100644 --- a/common/lqt_common.hpp +++ b/common/lqt_common.hpp @@ -111,6 +111,8 @@ extern void lqtL_pusharguments (lua_State *, char **); extern int lqtL_getflags (lua_State *, int, const char *); extern void lqtL_pushflags (lua_State *, int, const char *); +extern "C" int luaopen_qtbase (lua_State *); + #endif // __LQT_COMMON_HPP -- 2.11.4.GIT