CodeBlocks offers also the possibility of using menu actions in scripts which can be assigned in a build target to control the generation of your project. Perhaps in some situation this helps too. Here an example:
function SetBuildOptions(base)
{
if(PLATFORM == PLATFORM_MSW)
{
local CompilerId = base.GetCompilerID();
if(CompilerId.Matches(_T("gcc")))
{
local CF = GetCompilerFactory();
if(!IsNull(CF))
{
local Version = CF.GetCompilerVersionString(CompilerId);
// LogDebug(Version);
// check how this string looks like and compare with 4.2.0
local bDoIt = (Version >= _T("4.2.0"));
if(bDoIt)
{
base.AddCompilerOption(_T("-Wno-attributes"));
}
}
}
}
} // end of SetBuildOptions
The functions which can be accessed in a script are documented at the CB wiki page.