Code::Blocks Forums

User forums => General (but related to Code::Blocks) => Topic started by: Alpha on September 01, 2011, 05:01:47 am

Title: wxWidgets Code::Blocks project
Post by: Alpha on September 01, 2011, 05:01:47 am
I spent some time and assembled a Code::Blocks project to build several configurations of wxWidgets 2.8.12 (with MinGW).  The project file saves me a lot of time as Code::Blocks utilizes both of my cores to compile, cutting the time in half.  If anyone would like to try it, just decompress the project file (http://ngcoding.tech.officelive.com/Documents/wxWidgets-2.8.12.7z) (7zip (http://www.7-zip.org/) compression) into wxWidgets2.8.12\build\msw, however, I must warn you that although there is a shared multi-lib target, it does fail partway through (if someone knows why, please tell me).  (Note the project variable VENDOR is currently set to cb, but can be changed.)

One curious thing I noticed in making this is that although Code::Blocks allows for the import library of a dynamic library to have a custom name, it is not saved upon exit.  Perhaps an oversight in the file format?
Title: Re: wxWidgets Code::Blocks project
Post by: stahta01 on September 01, 2011, 06:37:06 am
Code
"cmd /c if not exist ..\..\lib\gcc_dll\mswu\wx\setup.h copy ..\..\include\wx\msw\setup.h ..\..\lib\gcc_dll\mswu\wx\setup.h"

After glancing at your cbp file, I noticed a common mistake.
You need to copy ..\..\include\wx\msw\setup0.h to ..\..\include\wx\msw\setup.h if the second file does not exist. This is done the first time the mingw makefile is ran.

Tim S.
Title: Re: wxWidgets Code::Blocks project
Post by: ollydbg on September 01, 2011, 07:16:39 am
The project file saves me a lot of time as Code::Blocks utilizes both of my cores to compile, cutting the time in half. 
If you use makefile, you can also achieve this by using something like:
Code
mingw32-make.exe -j4 -f makefile.gcc

Anyway, using a cbp file is also great contribution, hope the wx guys will adopt your contribution.
By the way, is it easy to create this cbp file. I would suggest if it possible to create such cbp files for wx's sample code.
Title: Re: wxWidgets Code::Blocks project
Post by: stahta01 on September 01, 2011, 07:48:47 am
By the way, is it easy to create this cbp file. I would suggest if it possible to create such cbp files for wx's sample code.

FYI: I did some research in creating "cbp files for wx's sample code." the work is almost done (or done completely) by the wxCode wxDemo project.

Tim S.
Title: Re: wxWidgets Code::Blocks project
Post by: ollydbg on September 01, 2011, 07:56:13 am
By the way, is it easy to create this cbp file. I would suggest if it possible to create such cbp files for wx's sample code.

FYI: I did some research in creating "cbp files for wx's sample code." the work is almost done (or done completely) by the wxCode wxDemo project.

Tim S.
Thanks for the info.
Can you show us the link of wxCode/wxDemo? I just search on the wxCode webpage, but I can't find them. The remind that three years ago, when I'm a beginner to wx and c::b, I would like they should supply the wxSamples' cbp file, so I would easily learn wx code under C::B, otherwise, I need to use the command line to build the wxSample, and not easy to debug.
Title: Re: wxWidgets Code::Blocks project
Post by: stahta01 on September 01, 2011, 04:01:50 pm
Can you show us the link of wxCode/wxDemo?

Example source code links; so you can look at source code first
http://wxcode.svn.sourceforge.net/viewvc/wxcode/trunk/wxCode/components/wxdemo/build/
http://wxcode.svn.sourceforge.net/viewvc/wxcode/trunk/wxCode/components/wxdemo/wxWidgets/demoFiles/animate/

Link to full download
http://sourceforge.net/projects/wxcode/files/Components/wxDemo/

The source code files are 2009 Premake files; Premake files can create Code::Blocks projects.
Problem the files are two years old; but, he has the needed Premake command in his SVN.
No idea if the lua files need updating for 2.8.12; but, I think they did for 2.9 builds.

I do not remember ever testing this and seeing if it works or contains Code::Blocks projects.
But, it should work OK.

Finished the download; code snippet from the first sample project animate.cbp
Code
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6" />

Tim S.


Title: Re: wxWidgets Code::Blocks project
Post by: Alpha on September 01, 2011, 11:59:52 pm
You need to copy ..\..\include\wx\msw\setup0.h to ..\..\include\wx\msw\setup.h if the second file does not exist.
Thanks, I had overlooked that.

If you use makefile, you can also achieve this by using something like:
Code
mingw32-make.exe -j4 -f makefile.gcc
Thank you for pointing that out.  (Hmm I really should look a little more carefully when I read documentation.)  However, testing Code::Blocks and a makefile with the same build configuration on the same number of cores - Code::Blocks was about ten seconds faster; plus 1 for Code::Blocks. :)

By the way, is it easy to create this cbp file. I would suggest if it possible to create such cbp files for wx's sample code.
I created the project file by hand (not very smart of me); I am looking into writing a small program that will recurse through the samples directories and generate some cbp's.

FYI: I did some research in creating "cbp files for wx's sample code." the work is almost done (or done completely) by the wxCode wxDemo project.
Interesting, I will look into it
Title: Re: wxWidgets Code::Blocks project
Post by: stahta01 on April 01, 2012, 03:29:38 am
Fixed the Shared Multilib Build.

I added sub-folder(s) under build/msw that holds the several files that need to be renamed because they need to be compiled to two different object files. (one for base and second for core)

I also fixed many issues with files not being part of the right target.

Note: I added some defines that may not be needed.
Also, I added some post build commands to try to make CB 10.05 work; I finally gave up; never removed post build commands.

Tim S.

Title: Re: wxWidgets Code::Blocks project
Post by: LETARTARE on November 17, 2012, 07:54:26 pm
hello,
@stahta01
Did you update the file "wxWidgets-2.8.12.cbp" to version 2.9.x ?
Sincerely
Title: Re: wxWidgets Code::Blocks project
Post by: stahta01 on November 17, 2012, 09:07:21 pm
hello,
@stahta01
Did you update the file "wxWidgets-2.8.12.cbp" to version 2.9.x ?
Sincerely

No, I have not done that.

I might try to do it next year; depends on if I have freetime.

Tim S.