diff options
Diffstat (limited to 'Source/cmLocalUnixMakefileGenerator3.cxx')
-rw-r--r-- | Source/cmLocalUnixMakefileGenerator3.cxx | 40 |
1 files changed, 18 insertions, 22 deletions
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index eca6bea..5b9d108 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -318,7 +318,7 @@ void cmLocalUnixMakefileGenerator3::WriteObjectConvenienceRule( // Add a rule to drive the rule below. std::vector<std::string> depends; - depends.push_back(output); + depends.emplace_back(output); std::vector<std::string> no_commands; this->WriteMakeRule(ruleFileStream, nullptr, outNoExt, depends, no_commands, true, true); @@ -685,7 +685,7 @@ void cmLocalUnixMakefileGenerator3::WriteSpecialTargetsTop( } // Add a fake suffix to keep HP happy. Must be max 32 chars for SGI make. std::vector<std::string> depends; - depends.push_back(".hpux_make_needs_suffix_list"); + depends.emplace_back(".hpux_make_needs_suffix_list"); this->WriteMakeRule(makefileStream, nullptr, ".SUFFIXES", depends, no_commands, false); if (this->IsWatcomWMake()) { @@ -852,7 +852,7 @@ void cmLocalUnixMakefileGenerator3::AppendRuleDepend( const char* nodep = this->Makefile->GetDefinition("CMAKE_SKIP_RULE_DEPENDENCY"); if (!nodep || cmSystemTools::IsOff(nodep)) { - depends.push_back(ruleFileName); + depends.emplace_back(ruleFileName); } } @@ -1333,8 +1333,8 @@ bool cmLocalUnixMakefileGenerator3::UpdateDependencies(const char* tgtInfo, // dependency vector. This means that in the normal case, when only // few or one file have been edited, then also only this one file is // actually scanned again, instead of all files for this target. - needRescanDependencies = !checker.Check( - dependFile.c_str(), internalDependFile.c_str(), validDependencies); + needRescanDependencies = + !checker.Check(dependFile, internalDependFile, validDependencies); } if (needRescanDependInfo || needRescanDirInfo || needRescanDependencies) { @@ -1347,7 +1347,7 @@ bool cmLocalUnixMakefileGenerator3::UpdateDependencies(const char* tgtInfo, cmsysTerminal_Color_ForegroundBold, message.c_str(), true, color); - return this->ScanDependencies(dir.c_str(), validDependencies); + return this->ScanDependencies(dir, validDependencies); } // The dependencies are already up-to-date. @@ -1355,7 +1355,7 @@ bool cmLocalUnixMakefileGenerator3::UpdateDependencies(const char* tgtInfo, } bool cmLocalUnixMakefileGenerator3::ScanDependencies( - const char* targetDir, + const std::string& targetDir, std::map<std::string, cmDepends::DependencyVector>& validDeps) { // Read the directory information file. @@ -1364,8 +1364,7 @@ bool cmLocalUnixMakefileGenerator3::ScanDependencies( std::string dirInfoFile = this->GetCurrentBinaryDirectory(); dirInfoFile += cmake::GetCMakeFilesDirectory(); dirInfoFile += "/CMakeDirectoryInformation.cmake"; - if (mf->ReadListFile(dirInfoFile.c_str()) && - !cmSystemTools::GetErrorOccuredFlag()) { + if (mf->ReadListFile(dirInfoFile) && !cmSystemTools::GetErrorOccuredFlag()) { haveDirectoryInfo = true; } @@ -1393,12 +1392,9 @@ bool cmLocalUnixMakefileGenerator3::ScanDependencies( cmSystemTools::Error("Directory Information file not found"); } - // create the file stream for the depends file - std::string dir = targetDir; - // Open the make depends file. This should be copy-if-different // because the make tool may try to reload it needlessly otherwise. - std::string ruleFileNameFull = dir; + std::string ruleFileNameFull = targetDir; ruleFileNameFull += "/depend.make"; cmGeneratedFileStream ruleFileStream( ruleFileNameFull, false, this->GlobalGenerator->GetMakefileEncoding()); @@ -1410,7 +1406,7 @@ bool cmLocalUnixMakefileGenerator3::ScanDependencies( // Open the cmake dependency tracking file. This should not be // copy-if-different because dependencies are re-scanned when it is // older than the DependInfo.cmake. - std::string internalRuleFileNameFull = dir; + std::string internalRuleFileNameFull = targetDir; internalRuleFileNameFull += "/depend.internal"; cmGeneratedFileStream internalRuleFileStream( internalRuleFileNameFull, false, @@ -1451,7 +1447,7 @@ bool cmLocalUnixMakefileGenerator3::ScanDependencies( scanner->SetFileComparison( this->GlobalGenerator->GetCMakeInstance()->GetFileComparison()); scanner->SetLanguage(lang); - scanner->SetTargetDirectory(dir.c_str()); + scanner->SetTargetDirectory(targetDir); scanner->Write(ruleFileStream, internalRuleFileStream); // free the scanner for this language @@ -1507,7 +1503,7 @@ void cmLocalUnixMakefileGenerator3::WriteLocalAllRules( // Just depend on the all target to drive the build. std::vector<std::string> depends; std::vector<std::string> no_commands; - depends.push_back("all"); + depends.emplace_back("all"); // Write the rule. this->WriteMakeRule(ruleFileStream, @@ -1571,7 +1567,7 @@ void cmLocalUnixMakefileGenerator3::WriteLocalAllRules( (targetName == "install/strip")) { // Provide a fast install target that does not depend on all // but has the same command. - depends.push_back("preinstall/fast"); + depends.emplace_back("preinstall/fast"); } else { // Just forward to the real target so at least it will work. depends.push_back(targetName); @@ -1593,7 +1589,7 @@ void cmLocalUnixMakefileGenerator3::WriteLocalAllRules( bool regenerate = !this->GlobalGenerator->GlobalSettingIsOn("CMAKE_SUPPRESS_REGENERATION"); if (regenerate) { - depends.push_back("cmake_check_build_system"); + depends.emplace_back("cmake_check_build_system"); } std::string progressDir = this->GetBinaryDirectory(); @@ -1643,7 +1639,7 @@ void cmLocalUnixMakefileGenerator3::WriteLocalAllRules( depends, commands, true); commands.clear(); depends.clear(); - depends.push_back("clean"); + depends.emplace_back("clean"); this->WriteMakeRule(ruleFileStream, "The main clean target", "clean/fast", depends, commands, true); @@ -1656,10 +1652,10 @@ void cmLocalUnixMakefileGenerator3::WriteLocalAllRules( this->Makefile->GetDefinition("CMAKE_SKIP_INSTALL_ALL_DEPENDENCY"); if (!noall || cmSystemTools::IsOff(noall)) { // Drive the build before installing. - depends.push_back("all"); + depends.emplace_back("all"); } else if (regenerate) { // At least make sure the build system is up to date. - depends.push_back("cmake_check_build_system"); + depends.emplace_back("cmake_check_build_system"); } commands.push_back( this->GetRecursiveMakeCall(mf2Dir.c_str(), recursiveTarget)); @@ -1720,7 +1716,7 @@ void cmLocalUnixMakefileGenerator3::ClearDependencies(cmMakefile* mf, // Clear the implicit dependency makefile. std::string dependFile = dir + "/depend.make"; - clearer.Clear(dependFile.c_str()); + clearer.Clear(dependFile); // Remove the internal dependency check file to force // regeneration. |