Explorar el Código

BUG: Work-around borland make bug that drops a rule completely if it has no dependencies or commands.

Brad King hace 20 años
padre
commit
f09778c4a5

+ 1 - 0
Source/cmGlobalBorlandMakefileGenerator.cxx

@@ -21,6 +21,7 @@
 
 cmGlobalBorlandMakefileGenerator::cmGlobalBorlandMakefileGenerator()
 {
+  m_EmptyRuleHackDepends = "NUL";
   m_FindMakeProgramFile = "CMakeBorlandFindMake.cmake";
   m_ForceUnixPaths = false;
 }

+ 7 - 0
Source/cmGlobalUnixMakefileGenerator3.cxx

@@ -147,6 +147,13 @@ void cmGlobalUnixMakefileGenerator3::WriteMainMakefile2()
 
   depends.clear();
 
+  // The all and preinstall rules might never have any dependencies
+  // added to them.
+  if(m_EmptyRuleHackDepends != "")
+    {
+    depends.push_back(m_EmptyRuleHackDepends);
+    }
+
   // Write and empty all:
   lg->WriteMakeRule(makefileStream, 
                     "The main recursive all target", "all", 

+ 6 - 0
Source/cmGlobalUnixMakefileGenerator3.h

@@ -119,6 +119,12 @@ protected:
   // does this generator need a requires step for any of its targets
   bool NeedRequiresStep(cmLocalUnixMakefileGenerator3 *lg, const char *);
 
+  // Some make programs (Borland) do not keep a rule if there are no
+  // dependencies or commands.  This is a problem for creating rules
+  // that might not do anything but might have other dependencies
+  // added later.  If non-empty this variable holds a fake dependency
+  // that can be added.
+  std::string m_EmptyRuleHackDepends;
 };
 
 #endif