User forums > General (but related to Code::Blocks)

Switch between debug/release, how?

<< < (2/3) > >>

Anonymous:
P.S. Keep forgetting to sign my posts...

Mike

mandrav:
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.

hd:
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

mandrav:
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.

hd:
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

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version