diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/CMakeVersion.cmake | 2 | ||||
-rw-r--r-- | Source/CPack/cmCPackGenerator.cxx | 7 | ||||
-rw-r--r-- | Source/CTest/cmCTestCoverageHandler.cxx | 10 | ||||
-rw-r--r-- | Source/cmForEachCommand.cxx | 8 | ||||
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 12 | ||||
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 18 | ||||
-rw-r--r-- | Source/cmNinjaNormalTargetGenerator.cxx | 4 | ||||
-rw-r--r-- | Source/cmNinjaTargetGenerator.cxx | 6 | ||||
-rw-r--r-- | Source/cmPolicies.h | 5 | ||||
-rw-r--r-- | Source/cmUtilitySourceCommand.cxx | 4 |
10 files changed, 53 insertions, 23 deletions
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 687332e..9eaf22c 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,7 +1,7 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 17) -set(CMake_VERSION_PATCH 20200530) +set(CMake_VERSION_PATCH 20200602) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index 08fd2a2..288dc58 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -921,11 +921,11 @@ int cmCPackGenerator::InstallCMakeProject( } } - if (nullptr != mf.GetDefinition("CPACK_ABSOLUTE_DESTINATION_FILES")) { + if (auto d = mf.GetDefinition("CPACK_ABSOLUTE_DESTINATION_FILES")) { if (!absoluteDestFiles.empty()) { absoluteDestFiles += ";"; } - absoluteDestFiles += mf.GetDefinition("CPACK_ABSOLUTE_DESTINATION_FILES"); + absoluteDestFiles += d; cmCPackLogger(cmCPackLog::LOG_DEBUG, "Got some ABSOLUTE DESTINATION FILES: " << absoluteDestFiles << std::endl); @@ -936,8 +936,7 @@ int cmCPackGenerator::InstallCMakeProject( GetComponentInstallDirNameSuffix(component); if (nullptr != this->GetOption(absoluteDestFileComponent)) { std::string absoluteDestFilesListComponent = - cmStrCat(this->GetOption(absoluteDestFileComponent), ';', - mf.GetDefinition("CPACK_ABSOLUTE_DESTINATION_FILES")); + cmStrCat(this->GetOption(absoluteDestFileComponent), ';', d); this->SetOption(absoluteDestFileComponent, absoluteDestFilesListComponent.c_str()); } else { diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx index daa10c9..b839c10 100644 --- a/Source/CTest/cmCTestCoverageHandler.cxx +++ b/Source/CTest/cmCTestCoverageHandler.cxx @@ -1215,8 +1215,6 @@ int cmCTestCoverageHandler::HandleGCovCoverage( while (cmSystemTools::GetLineFromStream(ifile, nl)) { cnt++; - // TODO: Handle gcov 3.0 non-coverage lines - // Skip empty lines if (nl.empty()) { continue; @@ -1227,6 +1225,14 @@ int cmCTestCoverageHandler::HandleGCovCoverage( continue; } + // Handle gcov 3.0 non-coverage lines + // non-coverage lines seem to always start with something not + // a space and don't have a ':' in the 9th position + // TODO: Verify that this is actually a robust metric + if (nl[0] != ' ' && nl[9] != ':') { + continue; + } + // Read the coverage count from the beginning of the gcov output // line std::string prefix = nl.substr(0, 12); diff --git a/Source/cmForEachCommand.cxx b/Source/cmForEachCommand.cxx index 32e7892..3b82e0a 100644 --- a/Source/cmForEachCommand.cxx +++ b/Source/cmForEachCommand.cxx @@ -113,8 +113,8 @@ bool cmForEachFunctionBlocker::ReplayItems( // At end of for each execute recorded commands // store the old value std::string oldDef; - if (mf.GetDefinition(this->Args.front())) { - oldDef = mf.GetDefinition(this->Args.front()); + if (auto d = mf.GetDefinition(this->Args.front())) { + oldDef = d; } auto restore = false; @@ -186,8 +186,8 @@ bool cmForEachFunctionBlocker::ReplayZipLists( // Store old values for iteration variables std::map<std::string, std::string> oldDefs; for (auto i = 0u; i < values.size(); ++i) { - if (mf.GetDefinition(iterationVars[i])) { - oldDefs.emplace(iterationVars[i], mf.GetDefinition(iterationVars[i])); + if (auto d = mf.GetDefinition(iterationVars[i])) { + oldDefs.emplace(iterationVars[i], d); } } diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index f2a51ab..dcdaaea 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -2651,7 +2651,8 @@ void cmGeneratorTarget::ComputeModuleDefinitionInfo( info.DefFileGenerated = false; #endif if (info.DefFileGenerated) { - info.DefFile = this->ObjectDirectory /* has slash */ + "exports.def"; + info.DefFile = + this->GetObjectDirectory(config) /* has slash */ + "exports.def"; } else if (!info.Sources.empty()) { info.DefFile = info.Sources.front()->GetFullPath(); } @@ -3858,8 +3859,6 @@ std::string cmGeneratorTarget::GetPchFileObject(const std::string& config, } std::string& filename = inserted.first->second; - this->AddSource(pchSource, true); - auto pchSf = this->Makefile->GetOrCreateSource( pchSource, false, cmSourceFileLocationKind::Known); @@ -7031,6 +7030,13 @@ void cmGeneratorTarget::ComputeLinkImplementationLibraries( // Skip entries that resolve to the target itself or are empty. std::string name = this->CheckCMP0004(lib); + if (this->GetPolicyStatusCMP0108() == cmPolicies::NEW) { + // resolve alias name + auto target = this->Makefile->FindTargetToUse(name); + if (target) { + name = target->GetName(); + } + } if (name == this->GetName() || name.empty()) { if (name == this->GetName()) { bool noMessage = false; diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index d019648..68e25fb 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1618,7 +1618,23 @@ bool cmGlobalGenerator::AddAutomaticSources() continue; } lg->AddUnityBuild(gt.get()); - lg->AddPchDependencies(gt.get()); + // Targets that re-use a PCH are handled below. + if (!gt->GetProperty("PRECOMPILE_HEADERS_REUSE_FROM")) { + lg->AddPchDependencies(gt.get()); + } + } + } + for (const auto& lg : this->LocalGenerators) { + for (const auto& gt : lg->GetGeneratorTargets()) { + if (gt->GetType() == cmStateEnums::INTERFACE_LIBRARY || + gt->GetType() == cmStateEnums::UTILITY || + gt->GetType() == cmStateEnums::GLOBAL_TARGET) { + continue; + } + // Handle targets that re-use a PCH from an above-handled target. + if (gt->GetProperty("PRECOMPILE_HEADERS_REUSE_FROM")) { + lg->AddPchDependencies(gt.get()); + } } } // The above transformations may have changed the classification of sources. diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index a283227..8f47010 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -1028,8 +1028,8 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement( gt->GetFullNameComponents(prefix, base, suffix, config); std::string dbg_suffix = ".dbg"; // TODO: Where to document? - if (mf->GetDefinition("CMAKE_DEBUG_SYMBOL_SUFFIX")) { - dbg_suffix = mf->GetDefinition("CMAKE_DEBUG_SYMBOL_SUFFIX"); + if (auto d = mf->GetDefinition("CMAKE_DEBUG_SYMBOL_SUFFIX")) { + dbg_suffix = d; } vars["TARGET_PDB"] = base + suffix + dbg_suffix; } diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index 5435183..d406c99 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -750,9 +750,9 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang, if (!mf->GetIsSourceFileTryCompile()) { rule.DepType = "gcc"; rule.DepFile = "$DEP_FILE"; - const std::string cl = mf->GetDefinition("CMAKE_C_COMPILER") - ? mf->GetSafeDefinition("CMAKE_C_COMPILER") - : mf->GetSafeDefinition("CMAKE_CXX_COMPILER"); + auto d = mf->GetDefinition("CMAKE_C_COMPILER"); + const std::string cl = + d ? d : mf->GetSafeDefinition("CMAKE_CXX_COMPILER"); cldeps = cmStrCat('"', cmSystemTools::GetCMClDepsCommand(), "\" ", lang, ' ', vars.Source, " $DEP_FILE $out \"", mf->GetSafeDefinition("CMAKE_CL_SHOWINCLUDES_PREFIX"), diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h index 4dff1d8..a82f421 100644 --- a/Source/cmPolicies.h +++ b/Source/cmPolicies.h @@ -318,6 +318,8 @@ class cmMakefile; SELECT(POLICY, CMP0106, "The Documentation module is removed.", 3, 18, 0, \ cmPolicies::WARN) \ SELECT(POLICY, CMP0107, "An ALIAS target cannot overwrite another target.", \ + 3, 18, 0, cmPolicies::WARN) \ + SELECT(POLICY, CMP0108, "A target cannot link to itself through an alias.", \ 3, 18, 0, cmPolicies::WARN) #define CM_SELECT_ID(F, A1, A2, A3, A4, A5, A6) F(A1) @@ -350,7 +352,8 @@ class cmMakefile; F(CMP0095) \ F(CMP0099) \ F(CMP0104) \ - F(CMP0105) + F(CMP0105) \ + F(CMP0108) /** \class cmPolicies * \brief Handles changes in CMake behavior and policies diff --git a/Source/cmUtilitySourceCommand.cxx b/Source/cmUtilitySourceCommand.cxx index 5865a19..6de78ff 100644 --- a/Source/cmUtilitySourceCommand.cxx +++ b/Source/cmUtilitySourceCommand.cxx @@ -84,8 +84,8 @@ bool cmUtilitySourceCommand(std::vector<std::string> const& args, std::string utilityDirectory = status.GetMakefile().GetCurrentBinaryDirectory(); std::string exePath; - if (status.GetMakefile().GetDefinition("EXECUTABLE_OUTPUT_PATH")) { - exePath = status.GetMakefile().GetDefinition("EXECUTABLE_OUTPUT_PATH"); + if (auto d = status.GetMakefile().GetDefinition("EXECUTABLE_OUTPUT_PATH")) { + exePath = d; } if (!exePath.empty()) { utilityDirectory = exePath; |