This patch makes Unicode the default build for windows. You can override the default by setting a WXRUBY_NO_UNICODE environment variable. Roy _______________________________________________ wxruby-users mailing list wxruby-users@rubyforge.org http://rubyforge.org/mailman/listinfo/wxruby-users
Sean Long wrote:>I like the second option because there is less chance of getting ''help >build fails on windows'' messages flooding the list from people who >don''t read the README. > >+1 Is there any help documentation (other than the README) for building this version on Windows? Will there be Windows binary(ies) available? Apologies if this has been discussed before. -- Shashank
The only problem I see is if on Windows wxWidgets defaults to an ascii build over a unicode build (which I think it does). So if the default for wxRuby is unicode and the user is using the default wxWidgets for Windows they are going to have build errors. Ways to handle this: - Put a note in the README for Windows users to know about this (other platforms use wx-config so wxRuby picks up what is installed). - Default to ascii and assume that anyone who wants unicode will have to set the flag in both wxWidgets and wxRuby. This also will need a note in the README. I like the second option because there is less chance of getting ''help build fails on windows'' messages flooding the list from people who don''t read the README. The code itself seems fine just the default setting I question. Sean On 9/12/06, Roy Sutton <roys at mindspring.com> wrote:> This patch makes Unicode the default build for windows. You can > override the default by setting a WXRUBY_NO_UNICODE environment variable. > > Roy > > > Index: wxruby2/rake/rakewx.rb > ==================================================================> RCS file: /var/cvs/wxruby/wxruby2/rake/rakewx.rb,v > retrieving revision 1.43 > diff -b -u -r1.43 rakewx.rb > --- wxruby2/rake/rakewx.rb 26 Aug 2006 00:10:34 -0000 1.43 > +++ wxruby2/rake/rakewx.rb 12 Sep 2006 23:21:10 -0000 > @@ -24,6 +24,10 @@ > $debug_build = ENV[''WXRUBY_DEBUG''] ? true : false > $release_build = ENV[''WXRUBY_RELEASE''] ? true : false > > +# Force non-unicode build with WXRUBY_NO_UNICODE. Unicode will be > +# the default build now > +$unicode_build = ENV[''WXRUBY_NO_UNICODE''] ? false : true > + > $verbose_debug = ENV[''WXRUBY_VERBOSE''] ? true : false > > if $release_build > @@ -32,6 +36,9 @@ > puts(''Enabling DEBUG build'') > end > > +if not $unicode_build > + puts(''Disabling UNICODE build'') > +end > > if($verbose_debug) > puts(''Enabling VERBOSE debugging output'') > > > Index: wxruby2/rake/rakemswin.rb > ==================================================================> RCS file: /var/cvs/wxruby/wxruby2/rake/rakemswin.rb,v > retrieving revision 1.11 > diff -b -u -r1.11 rakemswin.rb > --- wxruby2/rake/rakemswin.rb 23 Aug 2006 21:04:11 -0000 1.11 > +++ wxruby2/rake/rakemswin.rb 12 Sep 2006 21:27:47 -0000 > @@ -21,26 +21,32 @@ > else > $DEBUGPOSTFIX='''' > end > +if $unicode_build > + $UNICODEPOSTFIX=''u'' > +else > + $UNICODEPOSTFIX='''' > +end > +$POSTFIX = $UNICODEPOSTFIX + $DEBUGPOSTFIX > > $WXSRC="#$WXDIR/src/msw" > $WXINC="#$WXDIR/include" > $WXLIBDIR="#$WXDIR/lib/vc_lib" > -$INCTEMP="#$WXDIR/lib/vc_lib/msw#{$DEBUGPOSTFIX}" > +$INCTEMP="#$WXDIR/lib/vc_lib/msw#{$POSTFIX}" > > -$wx_libs = "#$WXLIBDIR/wxbase26#{$DEBUGPOSTFIX}.lib" -$wx_libs += " #$WXLIBDIR/wxbase26#{$DEBUGPOSTFIX}_net.lib"-$wx_libs += " #$WXLIBDIR/wxbase26#{$DEBUGPOSTFIX}_odbc.lib"-$wx_libs += " #$WXLIBDIR/wxbase26#{$DEBUGPOSTFIX}_xml.lib"-$wx_libs += " #$WXLIBDIR/wxmsw26#{$DEBUGPOSTFIX}_adv.lib"-$wx_libs += " #$WXLIBDIR/wxmsw26#{$DEBUGPOSTFIX}_core.lib"-$wx_libs += " #$WXLIBDIR/wxmsw26#{$DEBUGPOSTFIX}_dbgrid.lib"-$wx_libs += " #$WXLIBDIR/wxmsw26#{$DEBUGPOSTFIX}_html.lib"-$wx_libs += " #$WXLIBDIR/wxmsw26#{$DEBUGPOSTFIX}_media.lib"-$wx_libs += " #$WXLIBDIR/wxmsw26#{$DEBUGPOSTFIX}_xrc.lib"+$wx_libs = "#$WXLIBDIR/wxbase26#{$POSTFIX}.lib" > +$wx_libs += " #$WXLIBDIR/wxbase26#{$POSTFIX}_net.lib" > +$wx_libs += " #$WXLIBDIR/wxbase26#{$POSTFIX}_odbc.lib" > +$wx_libs += " #$WXLIBDIR/wxbase26#{$POSTFIX}_xml.lib" > +$wx_libs += " #$WXLIBDIR/wxmsw26#{$POSTFIX}_adv.lib" > +$wx_libs += " #$WXLIBDIR/wxmsw26#{$POSTFIX}_core.lib" > +$wx_libs += " #$WXLIBDIR/wxmsw26#{$POSTFIX}_dbgrid.lib" > +$wx_libs += " #$WXLIBDIR/wxmsw26#{$POSTFIX}_html.lib" > +$wx_libs += " #$WXLIBDIR/wxmsw26#{$POSTFIX}_media.lib" > +$wx_libs += " #$WXLIBDIR/wxmsw26#{$POSTFIX}_xrc.lib" > $wx_libs += " #$WXLIBDIR/wxexpat#{$DEBUGPOSTFIX}.lib" $wx_libs += " #$WXLIBDIR/wxjpeg#{$DEBUGPOSTFIX}.lib" $wx_libs += " #$WXLIBDIR/wxpng#{$DEBUGPOSTFIX}.lib"-$wx_libs += " #$WXLIBDIR/wxregex#{$DEBUGPOSTFIX}.lib"+$wx_libs += " #$WXLIBDIR/wxregex#{$POSTFIX}.lib" > $wx_libs += " #$WXLIBDIR/wxtiff#{$DEBUGPOSTFIX}.lib" $wx_libs += " #$WXLIBDIR/wxzlib#{$DEBUGPOSTFIX}.lib" > > @@ -64,6 +70,9 @@ > else > $ruby_cppflags += " -DNDEBUG " > end > +if $unicode_build > + $wx_cppflags += " -D_UNICODE -DUNICODE" > +end > > $extra_libs = [ > "gdi32.lib", "winspool.lib", "comdlg32.lib", > > > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > >
Sean Long wrote:> The only problem I see is if on Windows wxWidgets defaults to an ascii > build over a unicode build (which I think it does). So if the default > for wxRuby is unicode and the user is using the default wxWidgets for > Windows they are going to have build errors.But only if they build from source. Our gem will bundle a unicode build of wxWidgets, so for most users, including almost all non-technical users, it won''t matter. I suspect we could add a test in the rakefile that could give a clear error message if you attempted to build without a unicode version of wxWidgets available. I still vote (strongly) for unicode as the wxruby default on all platforms. Kevin
If you build using the MSVC project then you have to choose each target manually. I never did try the automatic build (or didn''t get it to work). So, choosing unicode is not a big problem for me. I do think it would be a good idea to test for the library targets -and- build them into a dependency for the .lib, so if you recompile wxW you can rake a new .so file. Roy Sean Long wrote:> The only problem I see is if on Windows wxWidgets defaults to an ascii > build over a unicode build (which I think it does). So if the default > for wxRuby is unicode and the user is using the default wxWidgets for > Windows they are going to have build errors. > > Ways to handle this: > - Put a note in the README for Windows users to know about this (other > platforms use wx-config so wxRuby picks up what is installed). > - Default to ascii and assume that anyone who wants unicode will have > to set the flag in both wxWidgets and wxRuby. This also will need a > note in the README. > > I like the second option because there is less chance of getting ''help > build fails on windows'' messages flooding the list from people who > don''t read the README. > > The code itself seems fine just the default setting I question. > > Sean > > On 9/12/06, Roy Sutton <roys at mindspring.com> wrote: > >> This patch makes Unicode the default build for windows. You can >> override the default by setting a WXRUBY_NO_UNICODE environment variable. >> >> Roy >> >> >> Index: wxruby2/rake/rakewx.rb >> ==================================================================>> RCS file: /var/cvs/wxruby/wxruby2/rake/rakewx.rb,v >> retrieving revision 1.43 >> diff -b -u -r1.43 rakewx.rb >> --- wxruby2/rake/rakewx.rb 26 Aug 2006 00:10:34 -0000 1.43 >> +++ wxruby2/rake/rakewx.rb 12 Sep 2006 23:21:10 -0000 >> @@ -24,6 +24,10 @@ >> $debug_build = ENV[''WXRUBY_DEBUG''] ? true : false >> $release_build = ENV[''WXRUBY_RELEASE''] ? true : false >> >> +# Force non-unicode build with WXRUBY_NO_UNICODE. Unicode will be >> +# the default build now >> +$unicode_build = ENV[''WXRUBY_NO_UNICODE''] ? false : true >> + >> $verbose_debug = ENV[''WXRUBY_VERBOSE''] ? true : false >> >> if $release_build >> @@ -32,6 +36,9 @@ >> puts(''Enabling DEBUG build'') >> end >> >> +if not $unicode_build >> + puts(''Disabling UNICODE build'') >> +end >> >> if($verbose_debug) >> puts(''Enabling VERBOSE debugging output'') >> >> >> Index: wxruby2/rake/rakemswin.rb >> ==================================================================>> RCS file: /var/cvs/wxruby/wxruby2/rake/rakemswin.rb,v >> retrieving revision 1.11 >> diff -b -u -r1.11 rakemswin.rb >> --- wxruby2/rake/rakemswin.rb 23 Aug 2006 21:04:11 -0000 1.11 >> +++ wxruby2/rake/rakemswin.rb 12 Sep 2006 21:27:47 -0000 >> @@ -21,26 +21,32 @@ >> else >> $DEBUGPOSTFIX='''' >> end >> +if $unicode_build >> + $UNICODEPOSTFIX=''u'' >> +else >> + $UNICODEPOSTFIX='''' >> +end >> +$POSTFIX = $UNICODEPOSTFIX + $DEBUGPOSTFIX >> >> $WXSRC="#$WXDIR/src/msw" >> $WXINC="#$WXDIR/include" >> $WXLIBDIR="#$WXDIR/lib/vc_lib" >> -$INCTEMP="#$WXDIR/lib/vc_lib/msw#{$DEBUGPOSTFIX}" >> +$INCTEMP="#$WXDIR/lib/vc_lib/msw#{$POSTFIX}" >> >> -$wx_libs = "#$WXLIBDIR/wxbase26#{$DEBUGPOSTFIX}.lib" -$wx_libs += " #$WXLIBDIR/wxbase26#{$DEBUGPOSTFIX}_net.lib"-$wx_libs += " #$WXLIBDIR/wxbase26#{$DEBUGPOSTFIX}_odbc.lib"-$wx_libs += " #$WXLIBDIR/wxbase26#{$DEBUGPOSTFIX}_xml.lib"-$wx_libs += " #$WXLIBDIR/wxmsw26#{$DEBUGPOSTFIX}_adv.lib"-$wx_libs += " #$WXLIBDIR/wxmsw26#{$DEBUGPOSTFIX}_core.lib"-$wx_libs += " #$WXLIBDIR/wxmsw26#{$DEBUGPOSTFIX}_dbgrid.lib"-$wx_libs += " #$WXLIBDIR/wxmsw26#{$DEBUGPOSTFIX}_html.lib"-$wx_libs += " #$WXLIBDIR/wxmsw26#{$DEBUGPOSTFIX}_media.lib"-$wx_libs += " #$WXLIBDIR/wxmsw26#{$DEBUGPOSTFIX}_xrc.lib"+$wx_libs = "#$WXLIBDIR/wxbase26#{$POSTFIX}.lib" >> +$wx_libs += " #$WXLIBDIR/wxbase26#{$POSTFIX}_net.lib" >> +$wx_libs += " #$WXLIBDIR/wxbase26#{$POSTFIX}_odbc.lib" >> +$wx_libs += " #$WXLIBDIR/wxbase26#{$POSTFIX}_xml.lib" >> +$wx_libs += " #$WXLIBDIR/wxmsw26#{$POSTFIX}_adv.lib" >> +$wx_libs += " #$WXLIBDIR/wxmsw26#{$POSTFIX}_core.lib" >> +$wx_libs += " #$WXLIBDIR/wxmsw26#{$POSTFIX}_dbgrid.lib" >> +$wx_libs += " #$WXLIBDIR/wxmsw26#{$POSTFIX}_html.lib" >> +$wx_libs += " #$WXLIBDIR/wxmsw26#{$POSTFIX}_media.lib" >> +$wx_libs += " #$WXLIBDIR/wxmsw26#{$POSTFIX}_xrc.lib" >> $wx_libs += " #$WXLIBDIR/wxexpat#{$DEBUGPOSTFIX}.lib" $wx_libs += " #$WXLIBDIR/wxjpeg#{$DEBUGPOSTFIX}.lib" $wx_libs += " #$WXLIBDIR/wxpng#{$DEBUGPOSTFIX}.lib"-$wx_libs += " #$WXLIBDIR/wxregex#{$DEBUGPOSTFIX}.lib"+$wx_libs += " #$WXLIBDIR/wxregex#{$POSTFIX}.lib" >> $wx_libs += " #$WXLIBDIR/wxtiff#{$DEBUGPOSTFIX}.lib" $wx_libs += " #$WXLIBDIR/wxzlib#{$DEBUGPOSTFIX}.lib" >> >> @@ -64,6 +70,9 @@ >> else >> $ruby_cppflags += " -DNDEBUG " >> end >> +if $unicode_build >> + $wx_cppflags += " -D_UNICODE -DUNICODE" >> +end >> >> $extra_libs = [ >> "gdi32.lib", "winspool.lib", "comdlg32.lib", >> >> >> _______________________________________________ >> wxruby-users mailing list >> wxruby-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/wxruby-users >> >> >> > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > > >
Shashank Date wrote:> Is there any help documentation (other than the README) for building > this version on Windows? > Will there be Windows binary(ies) available? Apologies if this has been > discussed before. >There will be a Windows binary gem. I''ll look over the help documentation for compiling on Windows and see if it needs any improvements. I did just make a note on the Wiki that says you need to set the WXWIN environment variable to build on Windows. Roy
committed, thanks alex Roy Sutton wrote:> This patch makes Unicode the default build for windows. You can > override the default by setting a WXRUBY_NO_UNICODE environment variable. > > Roy > ------------------------------------------------------------------------ > > Index: wxruby2/rake/rakewx.rb > ==================================================================> RCS file: /var/cvs/wxruby/wxruby2/rake/rakewx.rb,v > retrieving revision 1.43 > diff -b -u -r1.43 rakewx.rb > --- wxruby2/rake/rakewx.rb 26 Aug 2006 00:10:34 -0000 1.43 > +++ wxruby2/rake/rakewx.rb 12 Sep 2006 23:21:10 -0000 > @@ -24,6 +24,10 @@ > $debug_build = ENV[''WXRUBY_DEBUG''] ? true : false > $release_build = ENV[''WXRUBY_RELEASE''] ? true : false > > +# Force non-unicode build with WXRUBY_NO_UNICODE. Unicode will be > +# the default build now > +$unicode_build = ENV[''WXRUBY_NO_UNICODE''] ? false : true > + > $verbose_debug = ENV[''WXRUBY_VERBOSE''] ? true : false > > if $release_build > @@ -32,6 +36,9 @@ > puts(''Enabling DEBUG build'') > end > > +if not $unicode_build > + puts(''Disabling UNICODE build'') > +end > > if($verbose_debug) > puts(''Enabling VERBOSE debugging output'') > > ------------------------------------------------------------------------ > > Index: wxruby2/rake/rakemswin.rb > ==================================================================> RCS file: /var/cvs/wxruby/wxruby2/rake/rakemswin.rb,v > retrieving revision 1.11 > diff -b -u -r1.11 rakemswin.rb > --- wxruby2/rake/rakemswin.rb 23 Aug 2006 21:04:11 -0000 1.11 > +++ wxruby2/rake/rakemswin.rb 12 Sep 2006 21:27:47 -0000 > @@ -21,26 +21,32 @@ > else > $DEBUGPOSTFIX='''' > end > +if $unicode_build > + $UNICODEPOSTFIX=''u'' > +else > + $UNICODEPOSTFIX='''' > +end > +$POSTFIX = $UNICODEPOSTFIX + $DEBUGPOSTFIX > > $WXSRC="#$WXDIR/src/msw" > $WXINC="#$WXDIR/include" > $WXLIBDIR="#$WXDIR/lib/vc_lib" > -$INCTEMP="#$WXDIR/lib/vc_lib/msw#{$DEBUGPOSTFIX}" > +$INCTEMP="#$WXDIR/lib/vc_lib/msw#{$POSTFIX}" > > -$wx_libs = "#$WXLIBDIR/wxbase26#{$DEBUGPOSTFIX}.lib" -$wx_libs += " #$WXLIBDIR/wxbase26#{$DEBUGPOSTFIX}_net.lib"-$wx_libs += " #$WXLIBDIR/wxbase26#{$DEBUGPOSTFIX}_odbc.lib"-$wx_libs += " #$WXLIBDIR/wxbase26#{$DEBUGPOSTFIX}_xml.lib"-$wx_libs += " #$WXLIBDIR/wxmsw26#{$DEBUGPOSTFIX}_adv.lib"-$wx_libs += " #$WXLIBDIR/wxmsw26#{$DEBUGPOSTFIX}_core.lib"-$wx_libs += " #$WXLIBDIR/wxmsw26#{$DEBUGPOSTFIX}_dbgrid.lib"-$wx_libs += " #$WXLIBDIR/wxmsw26#{$DEBUGPOSTFIX}_html.lib"-$wx_libs += " #$WXLIBDIR/wxmsw26#{$DEBUGPOSTFIX}_media.lib"-$wx_libs += " #$WXLIBDIR/wxmsw26#{$DEBUGPOSTFIX}_xrc.lib"+$wx_libs = "#$WXLIBDIR/wxbase26#{$POSTFIX}.lib" > +$wx_libs += " #$WXLIBDIR/wxbase26#{$POSTFIX}_net.lib" > +$wx_libs += " #$WXLIBDIR/wxbase26#{$POSTFIX}_odbc.lib" > +$wx_libs += " #$WXLIBDIR/wxbase26#{$POSTFIX}_xml.lib" > +$wx_libs += " #$WXLIBDIR/wxmsw26#{$POSTFIX}_adv.lib" > +$wx_libs += " #$WXLIBDIR/wxmsw26#{$POSTFIX}_core.lib" > +$wx_libs += " #$WXLIBDIR/wxmsw26#{$POSTFIX}_dbgrid.lib" > +$wx_libs += " #$WXLIBDIR/wxmsw26#{$POSTFIX}_html.lib" > +$wx_libs += " #$WXLIBDIR/wxmsw26#{$POSTFIX}_media.lib" > +$wx_libs += " #$WXLIBDIR/wxmsw26#{$POSTFIX}_xrc.lib" > $wx_libs += " #$WXLIBDIR/wxexpat#{$DEBUGPOSTFIX}.lib" $wx_libs += " #$WXLIBDIR/wxjpeg#{$DEBUGPOSTFIX}.lib" $wx_libs += " #$WXLIBDIR/wxpng#{$DEBUGPOSTFIX}.lib"-$wx_libs += " #$WXLIBDIR/wxregex#{$DEBUGPOSTFIX}.lib"+$wx_libs += " #$WXLIBDIR/wxregex#{$POSTFIX}.lib" > $wx_libs += " #$WXLIBDIR/wxtiff#{$DEBUGPOSTFIX}.lib" $wx_libs += " #$WXLIBDIR/wxzlib#{$DEBUGPOSTFIX}.lib" > > @@ -64,6 +70,9 @@ > else > $ruby_cppflags += " -DNDEBUG " > end > +if $unicode_build > + $wx_cppflags += " -D_UNICODE -DUNICODE" > +end > > $extra_libs = [ > "gdi32.lib", "winspool.lib", "comdlg32.lib", > > ------------------------------------------------------------------------ > > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users
Maybe Matching Threads
- Official name change to wxruby2
- [884] branches/wxruby2/wxwidgets_282/rake/rakemswin.rb: Compile flag fixes for Windows/Wx 2.8 (Artur Kuptel)
- [975] branches/wxruby2/wxwidgets_282/rake/rakemswin.rb: Correct spacing for link command; remove odbc and db_table which aren''t
- Windows compilation problems
- build problems