diff options
author | Ken Martin <ken.martin@kitware.com> | 2005-06-10 14:45:08 (GMT) |
---|---|---|
committer | Ken Martin <ken.martin@kitware.com> | 2005-06-10 14:45:08 (GMT) |
commit | e559aa11ac92f0cedab7912f0672fb9471124467 (patch) | |
tree | 1036d72b3b57d354b367017e5b44d4a52bacc46d /Source | |
parent | e1870805b4a700e6739f73f66f9be77bcc3e82f4 (diff) | |
download | CMake-e559aa11ac92f0cedab7912f0672fb9471124467.zip CMake-e559aa11ac92f0cedab7912f0672fb9471124467.tar.gz CMake-e559aa11ac92f0cedab7912f0672fb9471124467.tar.bz2 |
ENH: added support for forcing recomputation of depends
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmGlobalUnixMakefileGenerator3.cxx | 16 | ||||
-rw-r--r-- | Source/cmLocalGenerator.h | 6 | ||||
-rw-r--r-- | Source/cmLocalUnixMakefileGenerator3.cxx | 15 | ||||
-rw-r--r-- | Source/cmLocalUnixMakefileGenerator3.h | 3 | ||||
-rw-r--r-- | Source/cmake.cxx | 5 | ||||
-rw-r--r-- | Source/cmake.h | 1 |
6 files changed, 39 insertions, 7 deletions
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index 8c3c997..8df3b69 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/Source/cmGlobalUnixMakefileGenerator3.cxx @@ -418,6 +418,22 @@ void cmGlobalUnixMakefileGenerator3 commands.push_back(lg->GetRecursiveMakeCall("Makefile2","clean")); lg->WriteMakeRule(makefileStream, "The main clean target", "clean", depends, commands); + + // write the depend rule, really a recompute depends rule + depends.clear(); + commands.clear(); + std::string cmakefileName = "Makefile.cmake"; + std::string runRule = + "$(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)"; + runRule += " --check-build-system "; + runRule += lg->Convert(cmakefileName.c_str(),cmLocalGenerator::NONE, + cmLocalGenerator::SHELL); + runRule += " 1"; + + commands.push_back(runRule); + lg->WriteMakeRule(makefileStream, "clear depends", + "depend", + depends, commands); } diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h index c1177d8..9a25b95 100644 --- a/Source/cmLocalGenerator.h +++ b/Source/cmLocalGenerator.h @@ -135,8 +135,10 @@ public: std::string ConvertToOutputForExisting(const char* p); /** Called from command-line hook to check dependencies. */ - virtual void CheckDependencies(cmMakefile* /* mf */, bool /* verbose */) {}; - + virtual void CheckDependencies(cmMakefile* /* mf */, + bool /* verbose */, + bool /* clear */) {}; + /** Called from command-line hook to scan dependencies. */ virtual bool ScanDependencies(std::vector<std::string> const& /* args */) {return true;}; diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index 1e2ce43..cee2a0d 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -1164,7 +1164,8 @@ cmLocalUnixMakefileGenerator3 "$(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)"; runRule += " --check-build-system "; runRule += this->Convert(cmakefileName.c_str(),NONE,SHELL); - + runRule += " 0"; + std::vector<std::string> no_depends; std::vector<std::string> commands; commands.push_back(runRule); @@ -2883,7 +2884,8 @@ void cmLocalUnixMakefileGenerator3 //---------------------------------------------------------------------------- void cmLocalUnixMakefileGenerator3::CheckDependencies(cmMakefile* mf, - bool verbose) + bool verbose, + bool clear) { // Get the list of languages that may have sources to check. const char* langDef = mf->GetDefinition("CMAKE_DEPENDS_LANGUAGES"); @@ -2914,7 +2916,14 @@ void cmLocalUnixMakefileGenerator3::CheckDependencies(cmMakefile* mf, checker(this->GetDependsChecker(*l, ".", f->c_str(), verbose)); if(checker.get()) { - checker->Check(); + if (clear) + { + checker->Clear(); + } + else + { + checker->Check(); + } } } } diff --git a/Source/cmLocalUnixMakefileGenerator3.h b/Source/cmLocalUnixMakefileGenerator3.h index 94022d3..4ee0ea1 100644 --- a/Source/cmLocalUnixMakefileGenerator3.h +++ b/Source/cmLocalUnixMakefileGenerator3.h @@ -128,7 +128,8 @@ public: virtual bool ScanDependencies(std::vector<std::string> const& args); /** Called from command-line hook to check dependencies. */ - virtual void CheckDependencies(cmMakefile* mf, bool verbose); + virtual void CheckDependencies(cmMakefile* mf, bool verbose, + bool clear); /** write some extra rules suahc as make test etc */ void WriteSpecialTargetsTop(std::ostream& makefileStream); diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 82816ca..dcc4c05 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -92,6 +92,8 @@ void cmNeedBackwardsCompatibility(const std::string& variable, cmake::cmake() { m_DebugTryCompile = false; + m_ClearBuildSystem = false; + #ifdef __APPLE__ struct rlimit rlp; if(!getrlimit(RLIMIT_STACK, &rlp)) @@ -304,6 +306,7 @@ void cmake::SetArgs(const std::vector<std::string>& args) else if((i < args.size()-1) && (arg.find("--check-build-system",0) == 0)) { m_CheckBuildSystem = args[++i]; + m_ClearBuildSystem = (atoi(args[++i].c_str()) > 0); } else if(arg.find("-V",0) == 0) { @@ -1637,7 +1640,7 @@ int cmake::CheckBuildSystem() { std::auto_ptr<cmLocalGenerator> lgd(ggd->CreateLocalGenerator()); lgd->SetGlobalGenerator(ggd); - lgd->CheckDependencies(mf, verbose); + lgd->CheckDependencies(mf, verbose, m_ClearBuildSystem); } // No need to rerun. diff --git a/Source/cmake.h b/Source/cmake.h index 94b875f..6d1c5f6 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -303,6 +303,7 @@ private: std::string m_CXXEnvironment; std::string m_CCEnvironment; std::string m_CheckBuildSystem; + bool m_ClearBuildSystem; bool m_DebugTryCompile; void UpdateConversionPathTable(); |