summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2006-12-14 19:30:41 (GMT)
committerBrad King <brad.king@kitware.com>2006-12-14 19:30:41 (GMT)
commitf7611f167cef7d5d517e901984f5f6c72aa61cf9 (patch)
tree49feb363a4022eaa70bffc59f01a5a7562c4e1ba
parent1fe21ae35ec49db320955a6d9c1cbf4807e2f9f3 (diff)
downloadCMake-f7611f167cef7d5d517e901984f5f6c72aa61cf9.zip
CMake-f7611f167cef7d5d517e901984f5f6c72aa61cf9.tar.gz
CMake-f7611f167cef7d5d517e901984f5f6c72aa61cf9.tar.bz2
ENH: Made cmMakefileTargetGenerator::GlobalGenerator have full type cmGlobalUnixMakefileGenerator3 to give access to all methods. Fixed broken custom targets with no commands for Borland makefiles when CMAKE_SKIP_RULE_DEPENDENCY is set.
-rw-r--r--Source/cmGlobalUnixMakefileGenerator3.h3
-rw-r--r--Source/cmMakefileExecutableTargetGenerator.cxx2
-rw-r--r--Source/cmMakefileLibraryTargetGenerator.cxx2
-rw-r--r--Source/cmMakefileTargetGenerator.cxx10
-rw-r--r--Source/cmMakefileTargetGenerator.h4
-rw-r--r--Source/cmMakefileUtilityTargetGenerator.cxx13
6 files changed, 24 insertions, 10 deletions
diff --git a/Source/cmGlobalUnixMakefileGenerator3.h b/Source/cmGlobalUnixMakefileGenerator3.h
index f074510..7bf675c 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.h
+++ b/Source/cmGlobalUnixMakefileGenerator3.h
@@ -115,6 +115,9 @@ public:
no rule. This is used for multiple output dependencies. */
std::string GetEmptyCommandHack() { return this->EmptyCommandsHack; }
+ /** Get the fake dependency to use when a rule has no real commands
+ or dependencies. */
+ std::string GetEmptyRuleHackDepends() { return this->EmptyRuleHackDepends; }
// change the build command for speed
virtual std::string GenerateBuildCommand
diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx
index 4b24a19a..4be2229 100644
--- a/Source/cmMakefileExecutableTargetGenerator.cxx
+++ b/Source/cmMakefileExecutableTargetGenerator.cxx
@@ -17,7 +17,7 @@
#include "cmMakefileExecutableTargetGenerator.h"
#include "cmGeneratedFileStream.h"
-#include "cmGlobalGenerator.h"
+#include "cmGlobalUnixMakefileGenerator3.h"
#include "cmLocalUnixMakefileGenerator3.h"
#include "cmMakefile.h"
#include "cmSourceFile.h"
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx
index d80fc7e..291b90a 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -17,7 +17,7 @@
#include "cmMakefileLibraryTargetGenerator.h"
#include "cmGeneratedFileStream.h"
-#include "cmGlobalGenerator.h"
+#include "cmGlobalUnixMakefileGenerator3.h"
#include "cmLocalUnixMakefileGenerator3.h"
#include "cmMakefile.h"
#include "cmSourceFile.h"
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 1adff5c..e941f58 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -65,7 +65,8 @@ cmMakefileTargetGenerator::New(cmLocalUnixMakefileGenerator3 *lg,
result->TargetName = tgtName;
result->Target = tgt;
result->LocalGenerator = lg;
- result->GlobalGenerator = lg->GetGlobalGenerator();
+ result->GlobalGenerator =
+ static_cast<cmGlobalUnixMakefileGenerator3*>(lg->GetGlobalGenerator());
result->Makefile = lg->GetMakefile();
return result;
}
@@ -891,9 +892,7 @@ void cmMakefileTargetGenerator
depends.clear();
depends.push_back(*o);
commands.clear();
- cmGlobalUnixMakefileGenerator3* gg =
- static_cast<cmGlobalUnixMakefileGenerator3*>(this->GlobalGenerator);
- std::string emptyCommand = gg->GetEmptyCommandHack();
+ std::string emptyCommand = this->GlobalGenerator->GetEmptyCommandHack();
if(!emptyCommand.empty())
{
commands.push_back(emptyCommand);
@@ -911,7 +910,8 @@ void cmMakefileTargetGenerator
this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, 0,
o->c_str(), depends, commands,
symbolic);
- gg->AddMultipleOutputPair(o->c_str(), depends[0].c_str());
+ this->GlobalGenerator->AddMultipleOutputPair(o->c_str(),
+ depends[0].c_str());
}
}
diff --git a/Source/cmMakefileTargetGenerator.h b/Source/cmMakefileTargetGenerator.h
index dd6bbe6..fb6562b 100644
--- a/Source/cmMakefileTargetGenerator.h
+++ b/Source/cmMakefileTargetGenerator.h
@@ -23,7 +23,7 @@ class cmCustomCommand;
class cmDependInformation;
class cmDepends;
class cmGeneratedFileStream;
-class cmGlobalGenerator;
+class cmGlobalUnixMakefileGenerator3;
class cmLocalUnixMakefileGenerator3;
class cmMakeDepend;
class cmMakefile;
@@ -121,7 +121,7 @@ protected:
cmStdString TargetName;
cmTarget *Target;
cmLocalUnixMakefileGenerator3 *LocalGenerator;
- cmGlobalGenerator *GlobalGenerator;
+ cmGlobalUnixMakefileGenerator3 *GlobalGenerator;
cmMakefile *Makefile;
bool DriveCustomCommandsOnDepends;
diff --git a/Source/cmMakefileUtilityTargetGenerator.cxx b/Source/cmMakefileUtilityTargetGenerator.cxx
index 51a848f..6ab1863 100644
--- a/Source/cmMakefileUtilityTargetGenerator.cxx
+++ b/Source/cmMakefileUtilityTargetGenerator.cxx
@@ -17,7 +17,7 @@
#include "cmMakefileUtilityTargetGenerator.h"
#include "cmGeneratedFileStream.h"
-#include "cmGlobalGenerator.h"
+#include "cmGlobalUnixMakefileGenerator3.h"
#include "cmLocalUnixMakefileGenerator3.h"
#include "cmMakefile.h"
#include "cmSourceFile.h"
@@ -58,6 +58,17 @@ void cmMakefileUtilityTargetGenerator::WriteRuleFiles()
objTarget += this->BuildFileName;
this->LocalGenerator->AppendRuleDepend(depends, objTarget.c_str());
+ // If the rule is empty add the special empty rule dependency needed
+ // by some make tools.
+ if(depends.empty() && commands.empty())
+ {
+ std::string hack = this->GlobalGenerator->GetEmptyRuleHackDepends();
+ if(!hack.empty())
+ {
+ depends.push_back(hack);
+ }
+ }
+
// Write the rule.
this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, 0,
this->Target->GetName(),