I ran across this also: the fix is to CompilerGCC::GetNextStateBasedOnJob as:
case bsProjectDone:
{
// switch to next project in workspace
if (m_pBuildingProject)
m_pBuildingProject->SetCurrentlyCompilingTarget(0);
m_NextBuildState = bsProjectPreBuild;
//(ICC 2010/05/23) CB bug: bsProjectPreBuild being invoked twice
//return DoBuild(clean, build) >= 0 ? bsProjectPreBuild : bsNone;
return DoBuild(clean, build) >= 0 ? bsTargetPreBuild : bsNone;
}
default:
break;
}
return bsNone;
It should be returning bsTargetPreBuild, not bsProjectPreBuild.
The return DoBuild() has already done the bsProjectPreBuild, so when it returns
it's time for the bsTargetPreBuild.
And while you're in there ;-)
// create a new process
m_ProcessOutputFiles[procIndex] = (cmd->isLink && cmd->target) ? cmd->target->GetOutputFilename() : wxString();
Manager::Get()->GetMacrosManager()->ReplaceMacros(m_ProcessOutputFiles[procIndex]); //(ICC 2010/06/14)
If the macros aren't replace in the output file name, OnJobEnd will get an open error trying to open such files as "bin/$(FILENAME).exe" etc. when it attempts to report the file size.
Thanks for the hint, it saves me a lot of time.
But I think it should be:
case bsProjectDone:
{
// switch to next project in workspace
if (m_pBuildingProject)
m_pBuildingProject->SetCurrentlyCompilingTarget(0);
m_NextBuildState = bsProjectPreBuild;
// return DoBuild(clean, build) >= 0 ? bsProjectPreBuild : bsNone;
return DoBuild(clean, build) >= 0 ? (clean && !build?bsTargetClean:bsTargetPreBuild) : bsNone;
}
default:
break;
}
return bsNone;
Otherwise it runs the target's prebuild-step on workspace cleaning.
What do you think ?
And it might make it more readable to use a "real" if-statement here.