Code::Blocks Forums

User forums => General (but related to Code::Blocks) => Topic started by: BiMode on January 05, 2005, 02:00:48 am

Title: Switch between debug/release, how?
Post by: BiMode on January 05, 2005, 02:00:48 am
Hello,

I like the way VC++ IDE does this (separate profile for debug build and release build).
So, how do I do this in CodeBlock?

Thanks.
Title: Switch between debug/release, how?
Post by: mandrav on January 05, 2005, 08:39:45 am
It hasn't been designed with Debug/Release configurations in mind. So this options is not available yet...
Title: debug/release
Post by: troels on January 07, 2005, 01:55:40 pm
Quote from: mandrav
It hasn't been designed with Debug/Release configurations in mind. So this options is not available yet...


A very useful option, please consider to add it soon, while the program is young (before the .cbp file format is fixed forever). Debug/Release directories as well. Parinya had this feature (even if he had a much weaker project file format). I wish I could do something in return, or do it myself, but I'm not up to speed with wxWidgets yet, and I have no money!

What about (monoplatform) Dev-Cpp? Have you left the project?

Best regards,
Troels
Title: Re: debug/release
Post by: mandrav on January 07, 2005, 06:39:19 pm
Quote from: troels

A very useful option, please consider to add it soon, while the program is young (before the .cbp file format is fixed forever). Debug/Release directories as well. Parinya had this feature (even if he had a much weaker project file format).

Just to get it out of the way, the .cbp format cannnot be fixed. It's XML. "X" stands for eXtensible ;)
About the Debug/Release configuration, it's something that will probably be done in the future. The main goal now is to make it stable, under all platforms.
Quote from: troels
What about (monoplatform) Dev-Cpp? Have you left the project?

Officially no (I 'm still listed as a developer) but practically, yes. I have left the project for around a year now.

Yiannis.
Title: Switch between debug/release, how?
Post by: Anonymous on January 19, 2005, 08:48:16 am
Can't different targets be established for this? They inherit compiler options, so setting proper directories for the object files and the output file and switching "generate debug info" in one of the instances should probably do the work (when the compiler options get fixed).
Title: Switch between debug/release, how?
Post by: Anonymous on January 19, 2005, 08:49:04 am
P.S. Keep forgetting to sign my posts...

Mike
Title: Switch between debug/release, how?
Post by: mandrav on January 19, 2005, 09:13:49 am
With the latest changes I 'm currently making in the build system, it will be possible.
I can see it, you 're gonna love the next update :)

Yiannis.
Title: Switch between debug/release, how?
Post by: hd on January 19, 2005, 12:51:12 pm
Hi Yiannis,

Did you see my "fix" for "one source-multi target" problem ?
Here it is again:


void MakefileGenerator::DoAddMakefileTarget_Objs(wxString& buffer)
{
    // NOTE (hd#1#): moved down m_ObjectFiles.Clear();
    wxString tmp;
    int targetsCount = m_Project->GetBuildTargetsCount();
    for (int x = 0; x < targetsCount; ++x)
    {
        ProjectBuildTarget* target = m_Project->GetBuildTarget(x);
        if (!target)
            break;
       
        m_ObjectFiles.Clear(); // NOTE (hd#1#): moved here
       
#ifdef __WXMSW__


--
Regards,
Hakki Dogusan
Title: Switch between debug/release, how?
Post by: mandrav on January 19, 2005, 01:54:32 pm
Hi Hakki,

of course I 've seen it :)

I didn't have the chance yet to test it though. The main problem with having a single file part of multiple targets, was that "make" would complain about its multiple appearences in the Makefile. So I had to make sure that every file in the Makefile appears only once (even if it is included in multiple targets) - IIRC that is the purpose of the m_ObjectFiles array. So, this file would be compiled with *only* one target's compile options (usually the first target in the list that it belongs).
Your patch actually reverses this behaviour and allows for multiple appearences of the same file in the Makefile.
I guess "make" complains and I 'm afraid that the file gets compiled with the same options, always. Not debug-release options depending on the target...

Can you confirm this?

Anyway, one of the latest changes is that it is possible for CB to use "direct build mode" - not "make". This allows for debug/release configurations :)

Yiannis.
Title: Switch between debug/release, how?
Post by: hd on January 19, 2005, 02:33:36 pm
Hi,

I re-checked generated makefile. It works here! :-)

I can send the makefile, if you want...

I hope "direct build mode"  doesn't remove "generate makefile" option, I'm using these
as a make-learning tool.

--
Regards,
Hakki Dogusan
Title: Switch between debug/release, how?
Post by: mandrav on January 19, 2005, 06:03:13 pm
Quote from: hd
Hi,

I re-checked generated makefile. It works here! :-)

I can send the makefile, if you want...


Do this, please...

Quote from: hd
I hope "direct build mode"  doesn't remove "generate makefile" option, I'm using these
as a make-learning tool.

No, you are able to select the build mode used ;)
Either way, even if "make" supported was dropped completely (which isn't), there would still be an option "Export Makefile" :)

Yiannis.