diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmGlobalNinjaGenerator.cxx | 4 | ||||
-rw-r--r-- | Source/cmLocalGenerator.cxx | 28 | ||||
-rw-r--r-- | Source/cmNinjaUtilityTargetGenerator.cxx | 2 | ||||
-rw-r--r-- | Source/cmQtAutoGenInitializer.cxx | 5 | ||||
-rw-r--r-- | Source/cmQtAutoMocUic.cxx | 26 |
5 files changed, 48 insertions, 17 deletions
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 843b0f4..f11cd50 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -1170,7 +1170,8 @@ void cmGlobalNinjaGenerator::AppendTargetDependsClosure( for (auto const& dep_target : this->GetTargetDirectDepends(target)) { if (dep_target->GetType() == cmStateEnums::INTERFACE_LIBRARY || - (this->EnableCrossConfigBuild() && !dep_target.IsCross())) { + (target->GetType() != cmStateEnums::UTILITY && + this->EnableCrossConfigBuild() && !dep_target.IsCross())) { continue; } @@ -1863,6 +1864,7 @@ void cmGlobalNinjaGenerator::WriteTargetClean(std::ostream& os) byproducts.push_back( this->BuildAlias(GetByproductsForCleanTargetName(), config)); } + byproducts.emplace_back(GetByproductsForCleanTargetName()); build.Variables["TARGETS"] = cmJoin(byproducts, " "); for (auto const& fileConfig : configs) { diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index c15ca7c..d1ab62b 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -2682,17 +2682,29 @@ void cmLocalGenerator::AddPchDependencies(cmGeneratorTarget* target) this->Makefile->GetSafeDefinition( cmStrCat("CMAKE_", lang, "_FLAGS_", configUpper)); + bool editAndContinueDebugInfo = + langFlags.find("/ZI") != std::string::npos || + langFlags.find("-ZI") != std::string::npos; + + bool enableDebuggingInformation = + langFlags.find("/Zi") != std::string::npos || + langFlags.find("-Zi") != std::string::npos; + // MSVC 2008 is producing both .pdb and .idb files with /Zi. - if ((langFlags.find("/ZI") != std::string::npos || - langFlags.find("-ZI") != std::string::npos) || - (cmSystemTools::VersionCompare(cmSystemTools::OP_LESS, - compilerVersion.c_str(), - "16.0") && - compilerId == "MSVC")) { + bool msvc2008OrLess = + cmSystemTools::VersionCompare( + cmSystemTools::OP_LESS, compilerVersion.c_str(), "16.0") && + compilerId == "MSVC"; + // but not when used via toolset -Tv90 + if (this->Makefile->GetSafeDefinition( + "CMAKE_VS_PLATFORM_TOOLSET") == "v90") { + msvc2008OrLess = false; + } + + if (editAndContinueDebugInfo || msvc2008OrLess) { CopyPchCompilePdb(config, target, *ReuseFrom, reuseTarget, { ".pdb", ".idb" }); - } else if ((langFlags.find("/Zi") != std::string::npos || - langFlags.find("-Zi") != std::string::npos)) { + } else if (enableDebuggingInformation) { CopyPchCompilePdb(config, target, *ReuseFrom, reuseTarget, { ".pdb" }); } diff --git a/Source/cmNinjaUtilityTargetGenerator.cxx b/Source/cmNinjaUtilityTargetGenerator.cxx index 8d863c3..c964bc1 100644 --- a/Source/cmNinjaUtilityTargetGenerator.cxx +++ b/Source/cmNinjaUtilityTargetGenerator.cxx @@ -100,6 +100,8 @@ void cmNinjaUtilityTargetGenerator::Generate(const std::string& config) if (genTarget->Target->GetType() != cmStateEnums::GLOBAL_TARGET) { lg->AppendTargetOutputs(genTarget, gg->GetByproductsForCleanTarget(), config); + std::copy(util_outputs.begin(), util_outputs.end(), + std::back_inserter(gg->GetByproductsForCleanTarget())); } lg->AppendTargetDepends(genTarget, deps, config, config); diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx index 1132852..bd0d6bf 100644 --- a/Source/cmQtAutoGenInitializer.cxx +++ b/Source/cmQtAutoGenInitializer.cxx @@ -1224,9 +1224,13 @@ bool cmQtAutoGenInitializer::InitAutogenTarget() if (this->Moc.ExecutableTarget != nullptr) { dependencies.push_back(this->Moc.ExecutableTarget->Target->GetName()); + } else if (!this->Moc.Executable.empty()) { + dependencies.push_back(this->Moc.Executable); } if (this->Uic.ExecutableTarget != nullptr) { dependencies.push_back(this->Uic.ExecutableTarget->Target->GetName()); + } else if (!this->Uic.Executable.empty()) { + dependencies.push_back(this->Uic.Executable); } // Create the custom command that outputs the timestamp file. @@ -1514,6 +1518,7 @@ bool cmQtAutoGenInitializer::SetupWriteAutogenInfo() info.SetConfig("PARSE_CACHE_FILE", this->AutogenTarget.ParseCacheFile); info.Set("DEP_FILE", this->AutogenTarget.DepFile); info.Set("DEP_FILE_RULE_NAME", this->AutogenTarget.DepFileRuleName); + info.SetArray("CMAKE_LIST_FILES", this->Makefile->GetListFiles()); info.SetArray("HEADER_EXTENSIONS", this->Makefile->GetCMakeInstance()->GetHeaderExtensions()); info.SetArrayArray( diff --git a/Source/cmQtAutoMocUic.cxx b/Source/cmQtAutoMocUic.cxx index f6cccfb..9cb172b 100644 --- a/Source/cmQtAutoMocUic.cxx +++ b/Source/cmQtAutoMocUic.cxx @@ -184,6 +184,7 @@ public: std::string DepFile; std::string DepFileRuleName; std::vector<std::string> HeaderExtensions; + std::vector<std::string> ListFiles; }; /** Shared common variables. */ @@ -191,7 +192,7 @@ public: { public: // -- Parse Cache - bool ParseCacheChanged = false; + std::atomic<bool> ParseCacheChanged = ATOMIC_VAR_INIT(false); cmFileTime ParseCacheTime; ParseCacheT ParseCache; @@ -1776,16 +1777,24 @@ bool cmQtAutoMocUicT::JobProbeDepsMocT::Probe(MappingT const& mapping, { // Check dependency timestamps std::string const sourceDir = SubDirPrefix(sourceFile); - for (std::string const& dep : mapping.SourceFile->ParseData->Moc.Depends) { + auto& dependencies = mapping.SourceFile->ParseData->Moc.Depends; + for (auto it = dependencies.begin(); it != dependencies.end(); ++it) { + auto& dep = *it; + // Find dependency file auto const depMatch = FindDependency(sourceDir, dep); if (depMatch.first.empty()) { - Log().Warning(GenT::MOC, - cmStrCat(MessagePath(sourceFile), " depends on ", - MessagePath(dep), - " but the file does not exist.")); - continue; + if (reason != nullptr) { + *reason = + cmStrCat("Generating ", MessagePath(outputFile), " from ", + MessagePath(sourceFile), ", because its dependency ", + MessagePath(dep), " vanished."); + } + dependencies.erase(it); + BaseEval().ParseCacheChanged = true; + return true; } + // Test if dependency file is older if (outputFileTime.Older(depMatch.second)) { if (reason != nullptr) { @@ -2176,7 +2185,7 @@ void cmQtAutoMocUicT::JobDepFilesMergeT::Process() return dependenciesFromDepFile(f.c_str()); }; - std::vector<std::string> dependencies; + std::vector<std::string> dependencies = BaseConst().ListFiles; ParseCacheT& parseCache = BaseEval().ParseCache; auto processMappingEntry = [&](const MappingMapT::value_type& m) { auto cacheEntry = parseCache.GetOrInsert(m.first); @@ -2257,6 +2266,7 @@ bool cmQtAutoMocUicT::InitFromInfo(InfoT const& info) !info.GetString("DEP_FILE_RULE_NAME", BaseConst_.DepFileRuleName, false) || !info.GetStringConfig("SETTINGS_FILE", SettingsFile_, true) || + !info.GetArray("CMAKE_LIST_FILES", BaseConst_.ListFiles, true) || !info.GetArray("HEADER_EXTENSIONS", BaseConst_.HeaderExtensions, true) || !info.GetString("QT_MOC_EXECUTABLE", MocConst_.Executable, false) || !info.GetString("QT_UIC_EXECUTABLE", UicConst_.Executable, false)) { |