Developer forums (C::B DEVELOPMENT STRICTLY!) > Compiler Framework Redesign
XML based compilers
MortenMacFly:
Al-right, concerning the next movement/discussion between devs, here is something to share. Please continue all discussion on that topic here, not via PM.
--- Quote from: MortenMacFly ---Maybe to clarify a few bits:
You have to differ between compiler settings like flags. Those are in XML files in C::B\share\CodeBlocks\compilers. Those are nicely grouped, i.e. common settings between compilers are shared.
If you change compiler flags (like adding a compiler flag in the compiler options) a copy of that XML file is created in C::B\share\CodeBlocks\compilers which superseeds the old one, but also includes ALL shared (common) parts.
Then you have user settings, like concrete path's which are mapped to the compiler's global settings available but are an "instance". Those are in default.conf and remain there (and belong there, too).
BTW: Alpha did a very nice WiKi article explaining the concept here:
http://wiki.codeblocks.org/index.php?title=Compiler_options_file
I meanwhile found the following issues: Compiler ID's have indeed changed for:
armelfgcc -> arm_elf_gcc
avrgcc -> avr_gcc
msp430gcc -> msp430_gcc
ppcgcc -> ppc_gcc
tricoregcc -> tricore_gcc
I think I know why, because in the initial algorithm to compile the ID there was a comment stating that to make a compiler ID valid XML all underscores need to be removed. This is wrong (however), so Alpha asked me to remove that check and I said yes. That's why now there is an underscore. Actually this is more correct, but causes trouble. The solution here is, also to check for the old style, when reading, but write the new style. (to project files).
--- End quote ---
MortenMacFly:
One issue, that is indeed true (and causes missing compiler flags) is the use of "-dumpversion" instead of "--version" for the compiler version detection regex. The result of dumpversion is 4.7 (so only major and minor), while --version shows more, e.g. 4.7.2 (including revision). Thats why the RegEx fails and therefore some compiler flags are missing.
So either we use --version, or make the RegEx just check for major.minor (which should be enough IMHO), or call both - the --version thing as a fallback.
Preferred solution?
MortenMacFly:
There is indeed a bug: If you make a copy of a compiler, the settings for the new compiler become applied to the last compiler already existing in the list.
I think the reason is here:
--- Code: ---void Compiler::ReloadOptions()
{
if (ConfigManager::LocateDataFile(wxT("compilers/options_") + GetID() + wxT(".xml"), sdDataUser | sdDataGlobal).IsEmpty())
return; // Do not clear if the options cannot be reloaded
m_Options.ClearOptions();
LoadDefaultOptions(GetID());
LoadDefaultRegExArray();
}
--- End code ---
That fails, because there is no XML file with such a name (yet) as it is a user-defined compiler. So this should better check for the parent compiler's ID in addition.
Alpha:
For the curious, I also started documenting the file format for defining pure XML compilers (page is only partially complete).
I am looking into these issues, and should be back with solutions soon.
killerbot:
don't use --version ==> for cross compilers this can become a mess, causing such regexes to fail very quickly.
-dumpversion, and just major/minor seems ok for me.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version