From: klaas.holwerda <kla...@nl...> - 2006-06-07 12:18:20
|
Hi John, Your idea to add precompiled headers like this does not work. Also othere changed you said you made, made no difference. hook_cpp_binding_header_includes = "#include \"general/include/a2dprec.h\"\n..#include \"wxbind/include/wxbind.h\"\n" I think the only thing that will be correct is to place the next at as the first include file in *.cpp generated. This is what the comment says, and how it worked before. ------------------------------------------------------------------------------- -- Set any #includes or other C++ code to be placed verbatim at the top of -- every generated cpp file or "" for none hook_cpp_binding_includes = "#include \"general/include/a2dprec.h\"\n" With this setting i get in my lubind.cpp: #ifdef __BORLANDC__ #pragma hdrstop #endif #ifndef WX_PRECOMP #include "wx/wx.h" #endif #include "wxlua/include/wxlstate.h" #include "luawraps/include/luabind.h" #include "general/include/a2dprec.h" But i need this, to make it work. #ifdef __BORLANDC__ #pragma hdrstop #endif #ifndef WX_PRECOMP #include "wx/wx.h" #endif #include "general/include/a2dprec.h" #include "wxlua/include/wxlstate.h" #include "luawraps/include/luabind.h" If i change in genwxbind.lua in the next function: function GenerateHookCppFileHeader(fileData) to this again, all is oke as before, what that be wrong in other situations? If so we better have and extra variable to contain a precompiled header include in the rules file. function GenerateHookCppFileHeader(fileData) table.insert(fileData, "// ----------------------------------------------------------------------------\n") table.insert(fileData, "// This file was generated by genwxbind.lua \n") table.insert(fileData, "//\n") table.insert(fileData, "// Any changes made to this file may be lost when file is regenerated.\n") table.insert(fileData, "// ----------------------------------------------------------------------------\n") table.insert(fileData, "\n") table.insert(fileData, "#ifdef __BORLANDC__\n") table.insert(fileData, " #pragma hdrstop\n") table.insert(fileData, "#endif\n") table.insert(fileData, "\n") table.insert(fileData, "#ifndef WX_PRECOMP\n") table.insert(fileData, " #include \"wx/wx.h\"\n") table.insert(fileData, "#endif\n") table.insert(fileData, hook_cpp_binding_includes or "") table.insert(fileData, "\n") table.insert(fileData, "\n") table.insert(fileData, "#include \"wxlua/include/wxlstate.h\"\n\n") table.insert(fileData, "\n") if includeList then for idx = 1, table.getn(includeList) do table.insert(fileData, "#include \""..includeList[idx].."\"\n") end end table.insert(fileData, "#include \""..hook_cpp_header_filename.."\"\n") table.insert(fileData, "\n") table.insert(fileData, "\n\n") return fileData end Regards, Klaas -- Unclassified |
From: John L. <jla...@gm...> - 2006-06-08 03:04:34
|
On 6/7/06, klaas.holwerda <kla...@nl...> wrote: > Your idea to add precompiled headers like this does not work. Also > othere changed you said you made, made no difference. > > hook_cpp_binding_header_includes = "#include > \"general/include/a2dprec.h\"\n..#include \"wxbind/include/wxbind.h\"\n" > > I think the only thing that will be correct is to place the next at as > the first include file in *.cpp generated. > This is what the comment says, and how it worked before. As I said, just reverting the change will break compilation on X Windows systems since the X windows headers very selfishly #define "Above" and "Below" to be numbers and you have to #undef them *after* including them. I've changed it so that there are now two ways to add code to the cpp files. Try using "hook_cpp_binding_includes" again as it is the first thing after wx/wxprec.h. hook_cpp_binding_includes hook_cpp_binding_post_includes Regards, John Labenski |
From: klaas.holwerda <kla...@nl...> - 2006-06-08 08:22:44
|
Hi John, John Labenski wrote: > On 6/7/06, klaas.holwerda <kla...@nl...> wrote: > >> Your idea to add precompiled headers like this does not work. Also >> othere changed you said you made, made no difference. >> >> hook_cpp_binding_header_includes = "#include >> \"general/include/a2dprec.h\"\n..#include \"wxbind/include/wxbind.h\"\n" >> >> I think the only thing that will be correct is to place the next at as >> the first include file in *.cpp generated. >> This is what the comment says, and how it worked before. >> > > As I said, just reverting the change will break compilation on X > Windows systems since the X windows headers very selfishly #define > "Above" and "Below" to be numbers and you have to #undef them *after* > including them. > After some searching i found those in wx_rules.lua. I first had no idea what you were talking about :-) But indeed how did the come up to use such defines?? Should they also be placed in say wxluacan_rules.lua, in order to make it work on Linux? Sofar i did not see a problem on Linux RedHat, but on Suse there are. So maybe this is what is the reason. Lost my Suse install, so can't check it for the moment. I understand the split, there is now hook_cpp_binding_post_includes where you put those in. > I've changed it so that there are now two ways to add code to the cpp > files. Try using "hook_cpp_binding_includes" again as it is the first > thing after wx/wxprec.h. > Works fine now, thanks a lot! Klaas -- Unclassified |
From: John L. <jla...@gm...> - 2006-06-08 14:39:51
|
On 6/8/06, klaas.holwerda <kla...@nl...> wrote: > Hi John, > > John Labenski wrote: > > On 6/7/06, klaas.holwerda <kla...@nl...> wrote: > > > >> Your idea to add precompiled headers like this does not work. Also > >> othere changed you said you made, made no difference. > >> > >> hook_cpp_binding_header_includes = "#include > >> \"general/include/a2dprec.h\"\n..#include \"wxbind/include/wxbind.h\"\n" > >> > >> I think the only thing that will be correct is to place the next at as > >> the first include file in *.cpp generated. > >> This is what the comment says, and how it worked before. > >> > > > > As I said, just reverting the change will break compilation on X > > Windows systems since the X windows headers very selfishly #define > > "Above" and "Below" to be numbers and you have to #undef them *after* > > including them. > > > After some searching i found those in wx_rules.lua. I first had no idea > what you were talking about :-) > But indeed how did the come up to use such defines?? > Should they also be placed in say wxluacan_rules.lua, in order to make > it work on Linux? > Sofar i did not see a problem on Linux RedHat, but on Suse there are. So > maybe this is what is the reason. > Lost my Suse install, so can't check it for the moment. You only need them if you have a function or something called Above(...) or Below(...). wxWidgets #undefs them in wx/layout.h since the layout constraints class has those functions. I've actually made the bindings #ifdef the layout constraints for < wxchkver26 since sizers have been around since 2.2 IIRC. So, no we don't need to add them elsewhere unless there is a compliation problem. -John |