diff options
author | Brad King <brad.king@kitware.com> | 2019-10-17 14:41:43 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-10-17 14:41:43 (GMT) |
commit | 6dedb9742094470196698a5009441e3860e61f2a (patch) | |
tree | 722cf5b830ffe47f3d76cd2e9ec00b57d78ff0f0 /Source | |
parent | 7aab792716bb647aac2b5802e6e21148471a0c79 (diff) | |
parent | 797689ab35c6f1edc37b120804e348b03ce7b161 (diff) | |
download | CMake-6dedb9742094470196698a5009441e3860e61f2a.zip CMake-6dedb9742094470196698a5009441e3860e61f2a.tar.gz CMake-6dedb9742094470196698a5009441e3860e61f2a.tar.bz2 |
Merge branch 'pch-makefile-depends' into release-3.16
Merge-request: !3928
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmMakefileTargetGenerator.cxx | 27 | ||||
-rw-r--r-- | Source/cmMakefileTargetGenerator.h | 5 |
2 files changed, 9 insertions, 23 deletions
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 51804d2..767f4e0 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -423,25 +423,17 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles( // Create the directory containing the object file. This may be a // subdirectory under the target's directory. - std::string dir = cmSystemTools::GetFilenamePath(obj); - cmSystemTools::MakeDirectory(this->LocalGenerator->ConvertToFullPath(dir)); + { + std::string dir = cmSystemTools::GetFilenamePath(obj); + cmSystemTools::MakeDirectory(this->LocalGenerator->ConvertToFullPath(dir)); + } // Save this in the target's list of object files. this->Objects.push_back(obj); this->CleanFiles.insert(obj); - // TODO: Remove - // std::string relativeObj - //= this->LocalGenerator->GetHomeRelativeOutputPath(); - // relativeObj += obj; - - // we compute some depends when writing the depend.make that we will also - // use in the build.make, same with depMakeFile std::vector<std::string> depends; - // generate the build rule file - this->WriteObjectBuildFile(obj, lang, source, depends); - // The object file should be checked for dependency integrity. std::string objFullPath = cmStrCat(this->LocalGenerator->GetCurrentBinaryDirectory(), '/', obj); @@ -450,12 +442,7 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles( cmSystemTools::CollapseFullPath(source.GetFullPath()); this->LocalGenerator->AddImplicitDepends(this->GeneratorTarget, lang, objFullPath, srcFullPath); -} -void cmMakefileTargetGenerator::WriteObjectBuildFile( - std::string& obj, const std::string& lang, cmSourceFile const& source, - std::vector<std::string>& depends) -{ this->LocalGenerator->AppendRuleDepend(depends, this->FlagFileNameFull.c_str()); this->LocalGenerator->AppendRuleDepends(depends, @@ -471,10 +458,14 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile( const std::string pchSource = this->GeneratorTarget->GetPchSource(config, lang); if (!pchSource.empty() && !source.GetProperty("SKIP_PRECOMPILE_HEADERS")) { - depends.push_back(this->GeneratorTarget->GetPchHeader(config, lang)); + std::string const& pchHeader = + this->GeneratorTarget->GetPchHeader(config, lang); + depends.push_back(pchHeader); if (source.GetFullPath() != pchSource) { depends.push_back(this->GeneratorTarget->GetPchFile(config, lang)); } + this->LocalGenerator->AddImplicitDepends(this->GeneratorTarget, lang, + objFullPath, pchHeader); } std::string relativeObj = diff --git a/Source/cmMakefileTargetGenerator.h b/Source/cmMakefileTargetGenerator.h index f464128..7b9c7a5 100644 --- a/Source/cmMakefileTargetGenerator.h +++ b/Source/cmMakefileTargetGenerator.h @@ -91,11 +91,6 @@ protected: // write the rules for an object void WriteObjectRuleFiles(cmSourceFile const& source); - // write the build rule for an object - void WriteObjectBuildFile(std::string& obj, const std::string& lang, - cmSourceFile const& source, - std::vector<std::string>& depends); - // write the depend.make file for an object void WriteObjectDependRules(cmSourceFile const& source, std::vector<std::string>& depends); |