From: John L. <jla...@gm...> - 2005-11-22 23:04:57
|
On 11/22/05, klaas.holwerda <kho...@xs...> wrote: > So wxArt2D has its own module with *.i files, leading to an extra > library with wxLua art2d bindings. To conclude, this is part of its > own project files. No need for a dedicated project file from wxLua itself= . > If however one only wants to link in a partly wxLua ( which can be the > case for certain wxArt2D applications, where lua is used only for a > command interpreter, and nothing fancy ), we get to the situation that > John explained. > And again here i think it should be the job of the wxart2d\project/make > files to generate this partly wxLua by taking only parts of *.i , having > a customized luasetup.h in wxArt2D. The beauty of the new genwxbind.lua program (over wxluawrap.lua) is that it generates .cpp files that contain all the appropriate #if statements to run in any platform and build. This means that you only run genwxbind whenever you edit the .i files. wxLua itself will distribute a full set of wrapped files for wxWidgets in modules/wxbind, I just haven't committed them yet until we get the build system figured out. I will add some docs about this. As I adapt my project and wxLua to work easily with external projects I'll write the docs. > In short i think we need a system for external wxLua project ( app or > lib ), in which on can take the complete wxLua or a partly binding and > at the same time extend it with extra bindings, and that alltogether > could best go into a library which belongs to that external project itsel= f. > I would non be suprized that in some far future there will be a > lua_art2dsetup.h next to the luasetup.h, making it able to choose > between the various wxArt2d modules wrapped into lua. wxArt2d should have it's own set of .i files (for wxArt2D) and the result of running genwxbind.lua (the generated .cpp wrapper files) in wxArt2d's cvs. This is what it looks like make wxLua (modules/wxlua modules/wxluadebug whatever else) -> have lib_wxlua lib_wxluadebug to link to in wxLua's build tree from wxArt2d compile you OWN lib_wxbind (from modules/wxbind) that contains the appropriate classes as set by luasetup.h (or just use the default, eg. you may not want to wrap wxStyledTextCtrl or wxGrid if you don't use it) -> have wx_wxluabind in wxArt2D's build tree somewhere compile wxArt2D's equivalent to modules/wxbind, pregenerated from your .i files by the same genwxbind.lua that wxLua uses itself, using your own settings similar to bindings/wxwidgets/wx.rules -> have lib_wxluaart2d in wxArt2D's build tree somewhere build the rest of wxArt2d -> lib_wxart2d... build your app and link to lib_wxlua, lib_wxluadebug, lib_wxluabind (your own version), lib_wxluabindart2d, whatever else. When you create a new lua_State you need to add the bindings in lib_wxluabindart2d (the ones in lib_wxluabind are automatically added). All of wxArt2d is accessible to wxLua in the lua "namespace" of wxart2d (or whatever you want to call it). This part needs some work and is completely untested by me, but there should be no implementation problems with it. > So i wonder if a VC project file is really helping in such a situation. > But of course it will be good to help a user on his way, since wxLua/lua > is often really meant to be used with/inside other applications to > extend them with scripting. We must make something which makes this > easy to do. > Maybe we must generate some sort of template makefile/project files, or > even better bakefile template itself, within wxLua, which makes this > easy to include in our own projects? This is another solution, but I think that the existing bakefiles/buildfiles are good enough for templates. My worry about luasetup.h is that I want to be able to use the wxLua build files from external projects. This should work for most people, the people who have really special needs will be on their own. > John would you be able to explain how you picture the use of > genwxbind.bat in an external project ? e.g. should one extend wx.rules? > In that case, one will need a copy of that file in its own projects i > think, but will it still work from there? Did you already use wxLua > like it is now in one of your own project (which has its own bindings ). > How do you do that? I have not used the new version yet, see above about wx.rules. Basicly wx.rules (the name is not important, see genwxbind.bat) sets all the output dirs and everything so that genwxbind can be run from anywhere and output to anywhere. I will try to test some things out later this week, but *FIRST* I really want to get the luasetup.h stuff figured out once and for all. I have some previous messages to read through so maybe it's already settled? :) -John |