While helping epsilon_da setup a wizard for GTK, we discovered the "other options" (including backticks) don't receive the macro substitution treatment that other build settings receive.
This patch rectifies that:
Index: src/sdk/compilercommandgenerator.cpp
===================================================================
--- src/sdk/compilercommandgenerator.cpp (revision 5535)
+++ src/sdk/compilercommandgenerator.cpp (working copy)
@@ -697,7 +697,11 @@
// compiler options
result << GetStringFromArray(compiler->GetCompilerOptions(), _T(' ')) << _T(" ");
- wxString bt = ExpandBackticks(result);
+ Manager::Get()->GetMacrosManager()->ReplaceMacros(result, target);
+// QuoteStringIfNeeded(result); //CAUSED PROBLEMS
+ FixPathSeparators(compiler, result);
+
+ wxString bt = ExpandBackticks(result);
SearchDirsFromBackticks(compiler, target, bt);
// add in array
@@ -724,7 +728,11 @@
// linker options
result << GetStringFromArray(compiler->GetLinkerOptions(), _T(' '));
- wxString bt = ExpandBackticks(result);
+ Manager::Get()->GetMacrosManager()->ReplaceMacros(result, target);
+// QuoteStringIfNeeded(result); //CAUSES PROBS
+ FixPathSeparators(compiler, result);
+
+ wxString bt = ExpandBackticks(result);
SearchDirsFromBackticks(compiler, target, bt);
// add in array
Reason to include this patch: Can help to make maintaining project options simpler (e.g. use a global variable $(#GTK_PKG_CONFIG) to point to the gtk pkg-config utility on windows so that projects can supply portable backticks like `$(#GTK_PKG_CONFIG) gtk+-2.0 --cflags`).
Reason *NOT* to include this patch: You tell me...
Nothing against the patch in general.
But one question/objection: why do you call FixPathSeperator here ?
Think of this case:
The compiler used has forceFwdSlashes set to true, and the user wants to define a string at the commandline like:
in build options we have to write in defines tab.
The string will be "fixed" to -DTEST="//"The String//""
what leads to an error at compile-time: g++: String//: No such file or directory