User forums > Using Code::Blocks
multi platform developement
johu:
Many thanks for the answer, the concept of "virtual target" is what I have in mind, a big point for C::B evaluating IDEs.
J.
mariocup:
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:
--- Code: ---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
--- End code ---
The functions which can be accessed in a script are documented at the CB wiki page.
MortenMacFly:
--- Quote from: mariocup on August 12, 2009, 11:50:19 am ---CodeBlocks offers also the possibility of using menu actions in scripts
--- End quote ---
Good point. Using build scripts you can achieve what I had mentioned with only one target. But you'll need to read yourself into scripting.
Navigation
[0] Message Index
[*] Previous page
Go to full version