pass it on to compilerXML.cpp (which will contain all auto-detection routines and loading of options/regexes).That's not what I mean, because this would not allow an "old-school" compiler easily.
I do not believe I see how any of the changes would disallow "old-school" compilers.
So having a "AutoDetector" class with a common interface that you can override if needed sounds most convenient to me.
However, this idea seems to have more promise. Forgive my lack of C++ knowledge, but would the way to do this use multiple inheritance:
class CompilerMINGW : public Compiler, public AutoDetector
members in AutoDetector
or something else?
The same applies to the version detection - as you know we call some compilers to obtain their version to adjust the required command line settings accordingly. We didn't talk about this so far btw... any plans for this?
Yes, I had separated out EvalXMLCondition()
(although, I am not certain if it was correct to put it in globals) so more items could be added to the <if>
statements with relative ease. Two items that I will be trying to add are generic run program (true on success, false on failed to launch). This could be used to add these types of commands
only when the relevant program is available.
And version detection/comparison. There is the easier method of checking the output of a command against a supplied regex. The other (probably better) way would be to figure out a generic method of parsing for the version string, caching it in m_VersionString
, and using some sort of generic comparison.
(One possible issue: what type of start-up cost will launching a series of external commands have?)
I plan to use GetID() for all of them, however, when Code::Blocks creates an ID, it removes "-" dash characters. I used this as a temporary bypass while I explore to see if there is a reason compiler ID's should not contain a dash.
Upon further inspection, it appears this transformation is to create valid element names; as "-"
characters are valid (except at the beginning), I have modified MakeValidID()