This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake".
The branch, master has been updated via df0586d8d5c99d870369f1f60f63431deb98a6ba (commit) via cd607ef5606cef0ffac822afe1dafa2615a5554d (commit) via 9d2ac86f45e6f05e8873a0cb3e5e61545fb7c8a7 (commit) via 14da7aedf2a3a8f5d25be9c577aaff01fa1f70b6 (commit) from 01d2944458289ac2601855b3fce2e3f66d850ed4 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=df0586d8d5c99d870369f1f60f63431deb98a6ba commit df0586d8d5c99d870369f1f60f63431deb98a6ba Merge: cd607ef 9d2ac86 Author: Brad King <brad.k...@kitware.com> AuthorDate: Fri Sep 20 14:27:58 2019 +0000 Commit: Kitware Robot <kwro...@kitware.com> CommitDate: Fri Sep 20 10:29:16 2019 -0400 Merge topic 'pch-source-list' 9d2ac86f45 Precompile Headers: Add precompile header file to source list Acked-by: Kitware Robot <kwro...@kitware.com> Merge-request: !3832 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cd607ef5606cef0ffac822afe1dafa2615a5554d commit cd607ef5606cef0ffac822afe1dafa2615a5554d Merge: 01d2944 14da7ae Author: Brad King <brad.k...@kitware.com> AuthorDate: Fri Sep 20 14:26:43 2019 +0000 Commit: Kitware Robot <kwro...@kitware.com> CommitDate: Fri Sep 20 10:28:04 2019 -0400 Merge topic 'smart_ptr/cmComputeLinkDepends' 14da7aedf2 cmComputeLinkDepends: remove manual memory deallocation Acked-by: Kitware Robot <kwro...@kitware.com> Merge-request: !3831 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9d2ac86f45e6f05e8873a0cb3e5e61545fb7c8a7 commit 9d2ac86f45e6f05e8873a0cb3e5e61545fb7c8a7 Author: Cristian Adam <cristian.a...@gmail.com> AuthorDate: Wed Sep 18 18:22:11 2019 +0200 Commit: Cristian Adam <cristian.a...@gmail.com> CommitDate: Thu Sep 19 13:23:00 2019 +0200 Precompile Headers: Add precompile header file to source list The precompile header file will be added to the list of files, and be part of the newly "Precompile Header File" source group. Also make sure the sources have the header as dependency. diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index afcd69f..521677a 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -2375,6 +2375,14 @@ void cmLocalGenerator::AddPchDependencies(cmGeneratorTarget* target, pch_sf->SetProperty("PCH_EXTENSION", pchExtension.c_str()); } + // Add pchHeader to source files, which will + // be grouped as "Precompile Header File" + auto pchHeader_sf = this->Makefile->GetOrCreateSource( + pchHeader, false, cmSourceFileLocationKind::Known); + std::string err; + pchHeader_sf->ResolveFullPath(&err); + target->AddSource(pchHeader); + for (auto& str : { std::ref(useOptionList), std::ref(createOptionList) }) { cmSystemTools::ReplaceString(str, "<PCH_HEADER>", pchHeader); cmSystemTools::ReplaceString(str, "<PCH_FILE>", pchFile); @@ -2399,7 +2407,8 @@ void cmLocalGenerator::AddPchDependencies(cmGeneratorTarget* target, } if (!this->GetGlobalGenerator()->IsXcode()) { - sf->SetProperty("OBJECT_DEPENDS", pchFile.c_str()); + sf->AppendProperty("OBJECT_DEPENDS", pchFile.c_str()); + sf->AppendProperty("OBJECT_DEPENDS", pchHeader.c_str()); sf->SetProperty("COMPILE_OPTIONS", useOptionList.c_str()); } } diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index c593939..acae17a 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -104,6 +104,7 @@ cmMakefile::cmMakefile(cmGlobalGenerator* globalGenerator, this->AddSourceGroup("", "^.*$"); this->AddSourceGroup("Source Files", CM_SOURCE_REGEX); this->AddSourceGroup("Header Files", CM_HEADER_REGEX); + this->AddSourceGroup("Precompile Header File", CM_PCH_REGEX); this->AddSourceGroup("CMake Rules", "\\.rule$"); this->AddSourceGroup("Resources", CM_RESOURCE_REGEX); this->AddSourceGroup("Object Files", "\\.(lo|o|obj)$"); diff --git a/Source/cmSourceFile.h b/Source/cmSourceFile.h index dd36d45..ff465c7 100644 --- a/Source/cmSourceFile.h +++ b/Source/cmSourceFile.h @@ -135,6 +135,8 @@ private: "hpj" \ "|bat)$" +#define CM_PCH_REGEX "cmake_pch\\.(h|hxx)$" + #define CM_RESOURCE_REGEX "\\.(pdf|plist|png|jpeg|jpg|storyboard|xcassets)$" #endif https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=14da7aedf2a3a8f5d25be9c577aaff01fa1f70b6 commit 14da7aedf2a3a8f5d25be9c577aaff01fa1f70b6 Author: Tushar Maheshwari <tushar27...@gmail.com> AuthorDate: Sun Sep 8 17:33:03 2019 +0530 Commit: Brad King <brad.k...@kitware.com> CommitDate: Wed Sep 18 14:32:56 2019 -0400 cmComputeLinkDepends: remove manual memory deallocation - Replace owning raw `DependSetList` pointer with direct object. - Use an extra `bool Initialized` flag to imitate `nullptr` semantics. diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx index 2ee4ca2..08113de 100644 --- a/Source/cmComputeLinkDepends.cxx +++ b/Source/cmComputeLinkDepends.cxx @@ -2,7 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmComputeLinkDepends.h" -#include "cmAlgorithms.h" #include "cmComputeComponentGraph.h" #include "cmGeneratorTarget.h" #include "cmGlobalGenerator.h" @@ -201,10 +200,7 @@ cmComputeLinkDepends::cmComputeLinkDepends(const cmGeneratorTarget* target, this->CCG = nullptr; } -cmComputeLinkDepends::~cmComputeLinkDepends() -{ - cmDeleteAll(this->InferredDependSets); -} +cmComputeLinkDepends::~cmComputeLinkDepends() = default; void cmComputeLinkDepends::SetOldLinkDirMode(bool b) { @@ -285,7 +281,7 @@ std::map<cmLinkItem, int>::iterator cmComputeLinkDepends::AllocateLinkEntry( item, static_cast<int>(this->EntryList.size())); auto lei = this->LinkEntryIndex.insert(index_entry).first; this->EntryList.emplace_back(); - this->InferredDependSets.push_back(nullptr); + this->InferredDependSets.emplace_back(); this->EntryConstraintGraph.emplace_back(); return lei; } @@ -325,7 +321,7 @@ int cmComputeLinkDepends::AddLinkEntry(cmLinkItem const& item) this->BFSQueue.push(qe); } else if (!entry.IsFlag) { // The item dependencies are not known. We need to infer them. - this->InferredDependSets[index] = new DependSetList; + this->InferredDependSets[index].Initialized = true; } } @@ -538,7 +534,7 @@ void cmComputeLinkDepends::AddLinkEntries(int depender_index, } // If this item needs to have dependencies inferred, do so. - if (this->InferredDependSets[dependee_index]) { + if (this->InferredDependSets[dependee_index].Initialized) { // Make sure an entry exists to hold the set for the item. dependSets[dependee_index]; } @@ -546,7 +542,7 @@ void cmComputeLinkDepends::AddLinkEntries(int depender_index, // Store the inferred dependency sets discovered for this list. for (auto const& dependSet : dependSets) { - this->InferredDependSets[dependSet.first]->push_back(dependSet.second); + this->InferredDependSets[dependSet.first].push_back(dependSet.second); } } @@ -573,14 +569,14 @@ void cmComputeLinkDepends::InferDependencies() depender_index < this->InferredDependSets.size(); ++depender_index) { // Skip items for which dependencies do not need to be inferred or // for which the inferred dependency sets are empty. - DependSetList* sets = this->InferredDependSets[depender_index]; - if (!sets || sets->empty()) { + DependSetList& sets = this->InferredDependSets[depender_index]; + if (!sets.Initialized || sets.empty()) { continue; } // Intersect the sets for this item. - DependSet common = sets->front(); - for (DependSet const& i : cmMakeRange(*sets).advance(1)) { + DependSet common = sets.front(); + for (DependSet const& i : cmMakeRange(sets).advance(1)) { DependSet intersection; std::set_intersection(common.begin(), common.end(), i.begin(), i.end(), std::inserter(intersection, intersection.begin())); diff --git a/Source/cmComputeLinkDepends.h b/Source/cmComputeLinkDepends.h index f0ac771..203cc68 100644 --- a/Source/cmComputeLinkDepends.h +++ b/Source/cmComputeLinkDepends.h @@ -106,8 +106,9 @@ private: }; struct DependSetList : public std::vector<DependSet> { + bool Initialized = false; }; - std::vector<DependSetList*> InferredDependSets; + std::vector<DependSetList> InferredDependSets; void InferDependencies(); // Ordering constraint graph adjacency list. ----------------------------------------------------------------------- Summary of changes: Source/cmComputeLinkDepends.cxx | 22 +++++++++------------- Source/cmComputeLinkDepends.h | 3 ++- Source/cmLocalGenerator.cxx | 11 ++++++++++- Source/cmMakefile.cxx | 1 + Source/cmSourceFile.h | 2 ++ 5 files changed, 24 insertions(+), 15 deletions(-) hooks/post-receive -- CMake _______________________________________________ Cmake-commits mailing list Cmake-commits@cmake.org https://cmake.org/mailman/listinfo/cmake-commits