Patch #1742 2006-12-19 22:34

naika

macro.Replace "$objects_output_dir" after "$options"
Download
1742-macro_Replace.patch (1.5 KB)
Category
Application::Bugfix
Status
Accepted
Close date
2007-04-12 12:56
Assigned to
mandrav
Index: src/sdk/compilercommandgenerator.cpp
===================================================================
--- src/sdk/compilercommandgenerator.cpp    (revision 3398)
+++ src/sdk/compilercommandgenerator.cpp    (working copy)
@@ -238,13 +238,6 @@
     FixPathSeparators(compiler, tmpObject);
     FixPathSeparators(compiler, tmpFlatObject);
 
-    if (target)
-    {  // this one has to come first, since wxString::Replace, otherwise $object would go first
-        // leaving nothing to replace for this $objects_output_dir
-        tmp = target->GetObjectOutput();
-        FixPathSeparators(compiler, tmp);
-        macro.Replace(_T("$objects_output_dir"), tmp);
-    }
     macro.Replace(_T("$compiler"), compilerStr);
     macro.Replace(_T("$linker"), compiler->GetPrograms().LD);
     macro.Replace(_T("$lib_linker"), compiler->GetPrograms().LIB);
@@ -257,6 +250,14 @@
     macro.Replace(_T("$libs"), m_LDAdd[target]);
     macro.Replace(_T("$file"), tmpFile);
     macro.Replace(_T("$dep_object"), tmpDeps);
+    if (target)
+    {  // this one has to come before $object, otherwise $object would go first
+       // leaving nothing to replace for this $objects_output_dir,
+       // and after $options because $objects_output_dir may be in compiler flags ($options).
+        tmp = target->GetObjectOutput();
+        FixPathSeparators(compiler, tmp);
+        macro.Replace(_T("$objects_output_dir"), tmp);
+    }
     macro.Replace(_T("$object"), tmpObject);
     macro.Replace(_T("$resource_output"), tmpObject);
     if (!target)
naika 2006-12-19 22:35

If $objects_output_dir is used into the Other options of Compiler, it is not replaced because $options is processed after $objects_output_dir.

With this patch, $objects_output_dir is processed after $options but before $object.

mandrav 2007-04-12 12:56

Patch applied, thank you.