(Warning: long post.)
Maybe it could be possible to add "Linker Flags" for "XML based compilers"?
This is sort of already available in the current system:
void AddOption(const wxString& name,
const wxString& option,
const wxString& category = _("General"),
const wxString& additionalLibs = wxEmptyString,
bool doChecks = false,
const wxString& checkAgainst = wxEmptyString,
const wxString& checkMessage = wxEmptyString);
Anything in additionalLibs
is sent to the linker. So in this XML system:
<Option name="Strip all symbols from binary (minimizes size)"
However, this can lead to confusion because it does not explicitly mention that compiler flags can control the linker. I am considering the possibility of a "Linker Flags" window, but I am not sure if there are enough common features to warrant the extra space usage (as the functionality is, in essence, already available).
- Some flags/functions are mutually exclusive on some compilers, sometimes depending on a third one, and sometimes a flag needs to be passed to another stage or requires another one being passed on a different stage
I am afraid your logic in this statement is to complicated for me to follow. If Code::Blocks current compiler system can do these, then this XML system can as well. Compilers are currently not completely decoupled into XML; only the contents of the Reset()
, and m_Commands
. These items are loaded from the compiler's XML options file (instead of being hard-coded).
- The build process would have to be reworked (and probably project files as well)
- Anything else would be the same as we already have, just with a new file format
All changes are currently highly localized; the compilers' interfaces function exactly the same, the only difference is how they populate their options (pure C++ compilers are still completely valid as well).
That said, the compilers I have converted are now a hybrid of C++ (for regexps and auto-detect) and XML (for options/flags). My final (planned) step would be to write a compilerXML.cpp
which would load any pure XML compilers that had been detected during start-up. (No compilers are, as of yet, dynamically loaded.)
don't just tack XML onto the existing system
This may have been exactly what I have done. However, I think it still holds the advantage of providing a framework to make compiler flags easily configurable. Have you had a chance to explore my implementation? - I know I am not an experienced programmer, so I would appreciate any critique on if this is even the "right" method to move forwards.
Would anyone like me to write up documentation for the current XML format? (Otherwise I will wait a bit until I am reasonably sure that it is set.)