From: Francesco M. <f18...@ya...> - 2005-11-22 08:59:42
|
Hi, Thanks John for the good explanation; now everything is crystal clear ;) >>So for the user it's "easy" to customize his wx builds: he creates its setup.h (probably >>modifying the default one) in the right folder and then gives the makefile command. >>This system works even for IDEs... > > The thing is, luasetup.h doesn't care what platform or build you're > using. The bindings themselves have all the wxUSE_XXX that are defined > in wxWidget's setup.h. So, reformulating the problem: wxLua doesn't care about build settings. The user must be able to build wxLua(bind) using exactly the same build settings (SHARED,BUILD,UNICODE, I mean) but with different luasetup.h files. So, copying luasetup.h as wxWidgets does, won't absolutely work, right ? > ********************************** > The solution: (or the only way I see it working) > > 1) In modules/wxbind/include/wxbind.h we have #include "luasetup.h" > with *no* path before it. > > 2) We put a complete version of luasetup.h in > modules/wxbind/src/luasetup.h so it'll be included using the default > search path of ./ that all compilers support. > > 3) In the makefile for wxluabind we have > WXLUASETUP_DIR = ./ > .cpp.o: > $(CXX) -I $(WXLUASETUP_DIR) -c $(CXXFLAGS) $(APPEXTRADEFS)-o $@ $< > > so that by default it uses the luasetup.h in modules/wxbind/src and > when you call the makefile from your project's makefiles you define > WXLUASETUP_DIR = "path/to/my/project/where/my/luasetup/is" > so it'll find your own luasetup.h first. I agree; this is a Good Solution for me and it's 100% compatible with bakefile. I would make WXLUASETUP_DIR an option for makefiles with a default value of "./", so that to build with default luasetup.h you do: nmake -fmakefile.vc but to build with your custom luasetup.h: nmake -fmakefile.vc WXLUASETUP_DIR=c:\myproject\include > 4) In the makefile for wxluabind we have > WXBIND_TARGET_LIBDIR = $(WXPREFIX)/lib (or whereever) > so that again, in your own project files you can do > WXBIND_TARGET_LIBDIR = /some/path/to/somewhere/else > > Now you can have two different libs for two different luasetup.h at > the same time. ok sure; also output path needs to be user-customizable. Again I would make WXBIND_TARGET_LIBDIR an option so that, expanding the previuos example: for default luasetup.h: nmake -fmakefile.vc but to build with your custom luasetup.h: nmake -fmakefile.vc WXLUASETUP_DIR=c:\myproject\include WXBIND_TARGET_LIBDIR=c:\myproject\lib > HOWEVER! This cannot be made to work for MSVS dsp files, can it? right; unfortunately IDEs do not allow you to specify options which are in "string" form. That is, you can make multiple configurations in a DSP file for an option which has a finite set of possible values (like BUILD=debug/release) but you can't do that for a "path" option. I think that we should make IDE project files fixed to work with default luasetup.h, and allow the user to build wxLua(bind) using his own luasetup.h only from command-line makefiles. After all, IMO this is not a big problem, specially if you want a custom wxLua(bind) for your project (which means that you're not a newbie). Let me know if I can proceed with solution above, Francesco |