Patch #2249 2007-11-19 23:49

pauliusz

Fix macros in pre/post build when building workspace
Download
2249-Fix_macros_in.patch (2.1 KB)
Category
Application::Bugfix
Status
Accepted
Close date
2007-11-23 08:43
Assigned to
biplab
Index: src/plugins/compilergcc/directcommands.cpp
===================================================================
--- src/plugins/compilergcc/directcommands.cpp    (revision 4640)
+++ src/plugins/compilergcc/directcommands.cpp    (working copy)
@@ -194,7 +194,7 @@
         {
             AppendArray(GetCompileFileCommand(target, pf->generatedFiles[i]), retGenerated); // recurse
         }
-        
+
         pfCustomBuild& pcfb = pf->customBuild[compiler->GetID()];
         compilerCmd = pcfb.useCustomBuildCommand
                         ? pcfb.buildCommand
@@ -454,7 +454,11 @@
         wxArrayString tmp;
         for (size_t i = 0; i < buildcmds.GetCount(); ++i)
         {
-            compiler->GenerateCommandLine(buildcmds[i], target, 0, wxEmptyString, wxEmptyString, wxEmptyString, wxEmptyString);
+            if(target)
+                compiler->GenerateCommandLine(buildcmds[i], target, 0, wxEmptyString, wxEmptyString, wxEmptyString, wxEmptyString);
+            else
+                compiler->GenerateCommandLine(buildcmds[i], m_pProject->GetCurrentlyCompilingTarget(), 0, wxEmptyString, wxEmptyString, wxEmptyString, wxEmptyString);
+
             tmp.Add(wxString(COMPILER_WAIT)); // all commands should wait for queue to empty first
             tmp.Add(wxString(COMPILER_SIMPLE_LOG) + buildcmds[i]);
             tmp.Add(buildcmds[i]);
@@ -480,7 +484,11 @@
         wxArrayString tmp;
         for (size_t i = 0; i < buildcmds.GetCount(); ++i)
         {
-            compiler->GenerateCommandLine(buildcmds[i], target, 0, wxEmptyString, wxEmptyString, wxEmptyString, wxEmptyString);
+            if(target)
+                compiler->GenerateCommandLine(buildcmds[i], target, 0, wxEmptyString, wxEmptyString, wxEmptyString, wxEmptyString);
+            else
+                compiler->GenerateCommandLine(buildcmds[i], m_pProject->GetCurrentlyCompilingTarget(), 0, wxEmptyString, wxEmptyString, wxEmptyString, wxEmptyString);
+
             tmp.Add(wxString(COMPILER_WAIT)); // all commands should wait for queue to empty first
             tmp.Add(wxString(COMPILER_SIMPLE_LOG) + buildcmds[i]);
             tmp.Add(buildcmds[i]);
pauliusz 2007-11-19 23:54

Part of the Bug #11665.

When building workspace with couple projects containing pre/post build steps with $(TARGET_*) macros, they got value from the active project, but not the one being build...