Read here: http://wiki.codeblocks.org/index.php?title=FAQ#Q:_How_do_I_troubleshoot_an_compiler_problem.3F
Thank you, that gave me exactly what I was looking for! :D I can see the options generated now.
The problem I trying to solve is that I don't seem to have 100% control over which wx-config I am using in Linux build targets, thereby leaving a big 'hole' in the configuration of Code::Blocks projects using wxWidgets. My projects have compiler settings like this
<Compiler>
<Add option="-Wall" />
<Add option="-g" />
<Add option="`wx-config --version=2.8 --toolkit=gtk2 --debug --cxxflags`" />
<Add option="`wx-config --cflags`" />
<Add option="-DNOPCH" />
<Add option="-D__WXDEBUG__" />
<Add option="-D_DEBUG" />
<Add option="-D__WX__" />
</Compiler>
As I have a locally compiled version of wxWidgets (using static libraries, among other things), I was trying to tell Code::Blocks to use the wx-config found in /usr/local/bin by means of the Code::Blocks global variable "wx" (defined as /usr/local):
<Compiler>
<Add option="-Wall" />
<Add option="-g" />
<Add option="`$(#wx)/bin/wx-config --version=2.8 --toolkit=gtk2 --debug --cxxflags`" />
<Add option="`$(#wx)/bin/wx-config --cflags`" />
<Add option="-DNOPCH" />
<Add option="-D__WXDEBUG__" />
<Add option="-D_DEBUG" />
<Add option="-D__WX__" />
</Compiler>
However, this didn't work, as it now becomes clear that Code::Blocks global variables don't get expanded in the context of "backticks". So instead I had to manually expand it to
<Compiler>
<Add option="-Wall" />
<Add option="-g" />
<Add option="`/usr/local/bin/wx-config --version=2.8 --toolkit=gtk2 --debug --cxxflags`" />
<Add option="`/usr/local/bin/wx-config --cflags`" />
<Add option="-DNOPCH" />
<Add option="-D__WXDEBUG__" />
<Add option="-D_DEBUG" />
<Add option="-D__WX__" />
</Compiler>
Which isn't 100% general, as I would like everything to be dependent in the wx global variable. Any tips on how to achive it is welcome.
But you answered my original question, so thanks for that :D
It would be easy to expand macros in backticked expressions before evaluating them:
Index: compilercommandgenerator.cpp
===================================================================
--- compilercommandgenerator.cpp (Revision 7071)
+++ compilercommandgenerator.cpp (Arbeitskopie)
@@ -919,6 +919,7 @@
/** Adds support for backtick'd expressions under windows. */
wxString CompilerCommandGenerator::ExpandBackticks(wxString& str)
{
+ Manager::Get()->GetMacrosManager()->ReplaceMacros(str);
wxString ret;
// this function is not windows-only anymore because we parse the backticked command's output
@other devs:
Is there any obvious reason I miss not to do it ?