mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-09-26 04:09:35 +03:00
clang-tidy: Use emplace
This commit is contained in:
committed by
Brad King
parent
2e5307a2a4
commit
ef61997b1b
@@ -15,7 +15,6 @@ modernize-*,\
|
||||
-modernize-raw-string-literal,\
|
||||
-modernize-return-braced-init-list,\
|
||||
-modernize-use-auto,\
|
||||
-modernize-use-emplace,\
|
||||
-modernize-use-equals-default,\
|
||||
-modernize-use-equals-delete,\
|
||||
-modernize-use-noexcept,\
|
||||
|
||||
@@ -71,8 +71,8 @@ int cmCPackDragNDropGenerator::InitializeInternal()
|
||||
// Starting with Xcode 4.3, look in "/Applications/Xcode.app" first:
|
||||
//
|
||||
std::vector<std::string> paths;
|
||||
paths.push_back("/Applications/Xcode.app/Contents/Developer/Tools");
|
||||
paths.push_back("/Developer/Tools");
|
||||
paths.emplace_back("/Applications/Xcode.app/Contents/Developer/Tools");
|
||||
paths.emplace_back("/Developer/Tools");
|
||||
|
||||
const std::string hdiutil_path =
|
||||
cmSystemTools::FindProgram("hdiutil", std::vector<std::string>(), false);
|
||||
|
||||
@@ -1036,7 +1036,8 @@ int cmCPackGenerator::DoPackage()
|
||||
* may update this during PackageFiles.
|
||||
* (either putting several names or updating the provided one)
|
||||
*/
|
||||
packageFileNames.push_back(tempPackageFileName ? tempPackageFileName : "");
|
||||
packageFileNames.emplace_back(tempPackageFileName ? tempPackageFileName
|
||||
: "");
|
||||
toplevel = tempDirectory;
|
||||
{ // scope that enables package generators to run internal scripts with
|
||||
// latest CMake policies enabled
|
||||
|
||||
@@ -610,7 +610,7 @@ bool cmCPackNSISGenerator::GetListOfSubdirectories(
|
||||
}
|
||||
}
|
||||
}
|
||||
dirs.push_back(topdir);
|
||||
dirs.emplace_back(topdir);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -340,16 +340,16 @@ int cmCPackPackageMakerGenerator::InitializeInternal()
|
||||
// If found, save result in the CPACK_INSTALLER_PROGRAM variable.
|
||||
|
||||
std::vector<std::string> paths;
|
||||
paths.push_back("/Applications/Xcode.app/Contents/Applications"
|
||||
"/PackageMaker.app/Contents/MacOS");
|
||||
paths.push_back("/Applications/Utilities"
|
||||
"/PackageMaker.app/Contents/MacOS");
|
||||
paths.push_back("/Applications"
|
||||
"/PackageMaker.app/Contents/MacOS");
|
||||
paths.push_back("/Developer/Applications/Utilities"
|
||||
"/PackageMaker.app/Contents/MacOS");
|
||||
paths.push_back("/Developer/Applications"
|
||||
"/PackageMaker.app/Contents/MacOS");
|
||||
paths.emplace_back("/Applications/Xcode.app/Contents/Applications"
|
||||
"/PackageMaker.app/Contents/MacOS");
|
||||
paths.emplace_back("/Applications/Utilities"
|
||||
"/PackageMaker.app/Contents/MacOS");
|
||||
paths.emplace_back("/Applications"
|
||||
"/PackageMaker.app/Contents/MacOS");
|
||||
paths.emplace_back("/Developer/Applications/Utilities"
|
||||
"/PackageMaker.app/Contents/MacOS");
|
||||
paths.emplace_back("/Developer/Applications"
|
||||
"/PackageMaker.app/Contents/MacOS");
|
||||
|
||||
std::string pkgPath;
|
||||
const char* inst_program = this->GetOption("CPACK_INSTALLER_PROGRAM");
|
||||
|
||||
@@ -232,7 +232,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
|
||||
|
||||
// do the build
|
||||
if (this->BuildTargets.empty()) {
|
||||
this->BuildTargets.push_back("");
|
||||
this->BuildTargets.emplace_back();
|
||||
}
|
||||
for (std::string const& tar : this->BuildTargets) {
|
||||
cmDuration remainingTime = std::chrono::seconds(0);
|
||||
|
||||
@@ -341,17 +341,17 @@ int cmCTestBuildHandler::ProcessHandler()
|
||||
// warnings and warning exceptions.
|
||||
std::vector<std::string>::size_type cc;
|
||||
for (cc = 0; cmCTestErrorMatches[cc]; cc++) {
|
||||
this->CustomErrorMatches.push_back(cmCTestErrorMatches[cc]);
|
||||
this->CustomErrorMatches.emplace_back(cmCTestErrorMatches[cc]);
|
||||
}
|
||||
for (cc = 0; cmCTestErrorExceptions[cc]; cc++) {
|
||||
this->CustomErrorExceptions.push_back(cmCTestErrorExceptions[cc]);
|
||||
this->CustomErrorExceptions.emplace_back(cmCTestErrorExceptions[cc]);
|
||||
}
|
||||
for (cc = 0; cmCTestWarningMatches[cc]; cc++) {
|
||||
this->CustomWarningMatches.push_back(cmCTestWarningMatches[cc]);
|
||||
this->CustomWarningMatches.emplace_back(cmCTestWarningMatches[cc]);
|
||||
}
|
||||
|
||||
for (cc = 0; cmCTestWarningExceptions[cc]; cc++) {
|
||||
this->CustomWarningExceptions.push_back(cmCTestWarningExceptions[cc]);
|
||||
this->CustomWarningExceptions.emplace_back(cmCTestWarningExceptions[cc]);
|
||||
}
|
||||
|
||||
// Pre-compile regular expressions objects for all regular expressions
|
||||
@@ -365,7 +365,7 @@ int cmCTestBuildHandler::ProcessHandler()
|
||||
cmCTestOptionalLog(this->CTest, DEBUG, \
|
||||
"Add " #strings ": " << s << std::endl, \
|
||||
this->Quiet); \
|
||||
(regexes).push_back(s.c_str()); \
|
||||
(regexes).emplace_back(s); \
|
||||
} \
|
||||
} while (false)
|
||||
|
||||
@@ -1034,7 +1034,7 @@ void cmCTestBuildHandler::ProcessBuffer(const char* data, size_t length,
|
||||
}
|
||||
} else {
|
||||
// Otherwise store pre-context for the next error
|
||||
this->PreContext.push_back(line);
|
||||
this->PreContext.emplace_back(line);
|
||||
if (this->PreContext.size() > this->MaxPreContext) {
|
||||
this->PreContext.erase(this->PreContext.begin(),
|
||||
this->PreContext.end() -
|
||||
|
||||
@@ -56,12 +56,12 @@ public:
|
||||
void SetCommand(const char* command)
|
||||
{
|
||||
this->CommandLineStrings.clear();
|
||||
this->CommandLineStrings.push_back(command);
|
||||
this->CommandLineStrings.emplace_back(command);
|
||||
}
|
||||
void AddArgument(const char* arg)
|
||||
{
|
||||
if (arg) {
|
||||
this->CommandLineStrings.push_back(arg);
|
||||
this->CommandLineStrings.emplace_back(arg);
|
||||
}
|
||||
}
|
||||
void SetWorkingDirectory(const char* dir) { this->WorkingDirectory = dir; }
|
||||
@@ -316,8 +316,7 @@ int cmCTestCoverageHandler::ProcessHandler()
|
||||
// setup the regex exclude stuff
|
||||
this->CustomCoverageExcludeRegex.clear();
|
||||
for (std::string const& rex : this->CustomCoverageExclude) {
|
||||
this->CustomCoverageExcludeRegex.push_back(
|
||||
cmsys::RegularExpression(rex.c_str()));
|
||||
this->CustomCoverageExcludeRegex.emplace_back(rex);
|
||||
}
|
||||
|
||||
if (this->HandleBullseyeCoverage(&cont)) {
|
||||
@@ -1005,7 +1004,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
|
||||
std::vector<std::string> basecovargs =
|
||||
cmSystemTools::ParseArguments(gcovExtraFlags.c_str());
|
||||
basecovargs.insert(basecovargs.begin(), gcovCommand);
|
||||
basecovargs.push_back("-o");
|
||||
basecovargs.emplace_back("-o");
|
||||
|
||||
// files is a list of *.da and *.gcda files with coverage data in them.
|
||||
// These are binary files that you give as input to gcov so that it will
|
||||
|
||||
@@ -146,7 +146,7 @@ void cmCTestLaunch::HandleRealArg(const char* arg)
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
this->RealArgs.push_back(arg);
|
||||
this->RealArgs.emplace_back(arg);
|
||||
}
|
||||
|
||||
void cmCTestLaunch::ComputeFileNames()
|
||||
@@ -534,9 +534,9 @@ void cmCTestLaunch::LoadScrapeRules()
|
||||
// Common compiler warning formats. These are much simpler than the
|
||||
// full log-scraping expressions because we do not need to extract
|
||||
// file and line information.
|
||||
this->RegexWarning.push_back("(^|[ :])[Ww][Aa][Rr][Nn][Ii][Nn][Gg]");
|
||||
this->RegexWarning.push_back("(^|[ :])[Rr][Ee][Mm][Aa][Rr][Kk]");
|
||||
this->RegexWarning.push_back("(^|[ :])[Nn][Oo][Tt][Ee]");
|
||||
this->RegexWarning.emplace_back("(^|[ :])[Ww][Aa][Rr][Nn][Ii][Nn][Gg]");
|
||||
this->RegexWarning.emplace_back("(^|[ :])[Rr][Ee][Mm][Aa][Rr][Kk]");
|
||||
this->RegexWarning.emplace_back("(^|[ :])[Nn][Oo][Tt][Ee]");
|
||||
|
||||
// Load custom match rules given to us by CTest.
|
||||
this->LoadScrapeRules("Warning", this->RegexWarning);
|
||||
|
||||
@@ -261,8 +261,8 @@ void cmCTestMemCheckHandler::InitializeResultsVectors()
|
||||
};
|
||||
this->GlobalResults.clear();
|
||||
for (int i = 0; cmCTestMemCheckResultStrings[i] != nullptr; ++i) {
|
||||
this->ResultStrings.push_back(cmCTestMemCheckResultStrings[i]);
|
||||
this->ResultStringsLong.push_back(cmCTestMemCheckResultLongStrings[i]);
|
||||
this->ResultStrings.emplace_back(cmCTestMemCheckResultStrings[i]);
|
||||
this->ResultStringsLong.emplace_back(cmCTestMemCheckResultLongStrings[i]);
|
||||
this->GlobalResults.push_back(0);
|
||||
}
|
||||
}
|
||||
@@ -528,11 +528,11 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking()
|
||||
switch (this->MemoryTesterStyle) {
|
||||
case cmCTestMemCheckHandler::VALGRIND: {
|
||||
if (this->MemoryTesterOptions.empty()) {
|
||||
this->MemoryTesterOptions.push_back("-q");
|
||||
this->MemoryTesterOptions.push_back("--tool=memcheck");
|
||||
this->MemoryTesterOptions.push_back("--leak-check=yes");
|
||||
this->MemoryTesterOptions.push_back("--show-reachable=yes");
|
||||
this->MemoryTesterOptions.push_back("--num-callers=50");
|
||||
this->MemoryTesterOptions.emplace_back("-q");
|
||||
this->MemoryTesterOptions.emplace_back("--tool=memcheck");
|
||||
this->MemoryTesterOptions.emplace_back("--leak-check=yes");
|
||||
this->MemoryTesterOptions.emplace_back("--show-reachable=yes");
|
||||
this->MemoryTesterOptions.emplace_back("--num-callers=50");
|
||||
}
|
||||
if (!this->CTest->GetCTestConfiguration("MemoryCheckSuppressionFile")
|
||||
.empty()) {
|
||||
@@ -586,11 +586,11 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking()
|
||||
std::string dpbdFile = this->CTest->GetBinaryDir() +
|
||||
"/Testing/Temporary/MemoryChecker.??.DPbd";
|
||||
this->BoundsCheckerDPBDFile = dpbdFile;
|
||||
this->MemoryTesterDynamicOptions.push_back("/B");
|
||||
this->MemoryTesterDynamicOptions.emplace_back("/B");
|
||||
this->MemoryTesterDynamicOptions.push_back(std::move(dpbdFile));
|
||||
this->MemoryTesterDynamicOptions.push_back("/X");
|
||||
this->MemoryTesterDynamicOptions.emplace_back("/X");
|
||||
this->MemoryTesterDynamicOptions.push_back(this->MemoryTesterOutputFile);
|
||||
this->MemoryTesterOptions.push_back("/M");
|
||||
this->MemoryTesterOptions.emplace_back("/M");
|
||||
break;
|
||||
}
|
||||
// these are almost the same but the env var used is different
|
||||
@@ -604,8 +604,8 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking()
|
||||
// The MemoryTesterDynamicOptions is setup with the -E env
|
||||
// Then the MemoryTesterEnvironmentVariable gets the
|
||||
// TSAN_OPTIONS string with the log_path in it.
|
||||
this->MemoryTesterDynamicOptions.push_back("-E");
|
||||
this->MemoryTesterDynamicOptions.push_back("env");
|
||||
this->MemoryTesterDynamicOptions.emplace_back("-E");
|
||||
this->MemoryTesterDynamicOptions.emplace_back("env");
|
||||
std::string envVar;
|
||||
std::string extraOptions;
|
||||
std::string suppressionsOption;
|
||||
|
||||
@@ -307,20 +307,20 @@ void cmCTestP4::SetP4Options(std::vector<char const*>& CommandOptions)
|
||||
{
|
||||
if (P4Options.empty()) {
|
||||
const char* p4 = this->CommandLineTool.c_str();
|
||||
P4Options.push_back(p4);
|
||||
P4Options.emplace_back(p4);
|
||||
|
||||
// The CTEST_P4_CLIENT variable sets the P4 client used when issuing
|
||||
// Perforce commands, if it's different from the default one.
|
||||
std::string client = this->CTest->GetCTestConfiguration("P4Client");
|
||||
if (!client.empty()) {
|
||||
P4Options.push_back("-c");
|
||||
P4Options.emplace_back("-c");
|
||||
P4Options.push_back(client);
|
||||
}
|
||||
|
||||
// Set the message language to be English, in case the P4 admin
|
||||
// has localized them
|
||||
P4Options.push_back("-L");
|
||||
P4Options.push_back("en");
|
||||
P4Options.emplace_back("-L");
|
||||
P4Options.emplace_back("en");
|
||||
|
||||
// The CTEST_P4_OPTIONS variable adds additional Perforce command line
|
||||
// options before the main command
|
||||
|
||||
@@ -532,7 +532,7 @@ bool cmCTestSVN::LoadRepositories()
|
||||
}
|
||||
|
||||
// Info for root repository
|
||||
this->Repositories.emplace_back("");
|
||||
this->Repositories.emplace_back();
|
||||
this->RootInfo = &(this->Repositories.back());
|
||||
|
||||
// Run "svn status" to get the list of external repositories
|
||||
|
||||
@@ -135,7 +135,7 @@ cmCTestScriptHandler::~cmCTestScriptHandler()
|
||||
void cmCTestScriptHandler::AddConfigurationScript(const char* script,
|
||||
bool pscope)
|
||||
{
|
||||
this->ConfigurationScripts.push_back(script);
|
||||
this->ConfigurationScripts.emplace_back(script);
|
||||
this->ScriptProcessScope.push_back(pscope);
|
||||
}
|
||||
|
||||
@@ -450,7 +450,7 @@ int cmCTestScriptHandler::ExtractVariables()
|
||||
updateVar, " specified without specifying CTEST_CVS_COMMAND.");
|
||||
return 12;
|
||||
}
|
||||
this->ExtraUpdates.push_back(updateVal);
|
||||
this->ExtraUpdates.emplace_back(updateVal);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -861,7 +861,7 @@ int cmCTestSubmitHandler::ProcessHandler()
|
||||
|
||||
// Submit Done.xml last
|
||||
if (this->SubmitPart[cmCTest::PartDone]) {
|
||||
files.push_back("Done.xml");
|
||||
files.emplace_back("Done.xml");
|
||||
}
|
||||
|
||||
if (ofs) {
|
||||
|
||||
@@ -1524,7 +1524,7 @@ void cmCTestTestHandler::AddConfigurations(
|
||||
}
|
||||
tempPath = filepath + filename;
|
||||
attempted.push_back(tempPath);
|
||||
attemptedConfigs.push_back("");
|
||||
attemptedConfigs.emplace_back();
|
||||
|
||||
if (!ctest->GetConfigType().empty()) {
|
||||
tempPath = filepath;
|
||||
@@ -1547,32 +1547,32 @@ void cmCTestTestHandler::AddConfigurations(
|
||||
tempPath += "Release/";
|
||||
tempPath += filename;
|
||||
attempted.push_back(tempPath);
|
||||
attemptedConfigs.push_back("Release");
|
||||
attemptedConfigs.emplace_back("Release");
|
||||
tempPath = filepath;
|
||||
tempPath += "Debug/";
|
||||
tempPath += filename;
|
||||
attempted.push_back(tempPath);
|
||||
attemptedConfigs.push_back("Debug");
|
||||
attemptedConfigs.emplace_back("Debug");
|
||||
tempPath = filepath;
|
||||
tempPath += "MinSizeRel/";
|
||||
tempPath += filename;
|
||||
attempted.push_back(tempPath);
|
||||
attemptedConfigs.push_back("MinSizeRel");
|
||||
attemptedConfigs.emplace_back("MinSizeRel");
|
||||
tempPath = filepath;
|
||||
tempPath += "RelWithDebInfo/";
|
||||
tempPath += filename;
|
||||
attempted.push_back(tempPath);
|
||||
attemptedConfigs.push_back("RelWithDebInfo");
|
||||
attemptedConfigs.emplace_back("RelWithDebInfo");
|
||||
tempPath = filepath;
|
||||
tempPath += "Deployment/";
|
||||
tempPath += filename;
|
||||
attempted.push_back(tempPath);
|
||||
attemptedConfigs.push_back("Deployment");
|
||||
attemptedConfigs.emplace_back("Deployment");
|
||||
tempPath = filepath;
|
||||
tempPath += "Development/";
|
||||
tempPath += filename;
|
||||
attempted.push_back(tempPath);
|
||||
attemptedConfigs.push_back("Deployment");
|
||||
attemptedConfigs.emplace_back("Deployment");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ public:
|
||||
// Check that the begin is the first non-space string on the line
|
||||
if ((beginPos == line.find_first_not_of(' ')) &&
|
||||
beginPos != std::string::npos) {
|
||||
beginSet.push_back("begin");
|
||||
beginSet.emplace_back("begin");
|
||||
coverageVector.push_back(-1);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ int main(int argc, char const* const* argv)
|
||||
if (strcmp(argv[j], "-debug") == 0) {
|
||||
debug = true;
|
||||
} else {
|
||||
args.push_back(argv[j]);
|
||||
args.emplace_back(argv[j]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -37,10 +37,10 @@ cmCursesMainForm::cmCursesMainForm(std::vector<std::string> const& args,
|
||||
this->AdvancedMode = false;
|
||||
this->NumberOfVisibleEntries = 0;
|
||||
this->OkToGenerate = false;
|
||||
this->HelpMessage.push_back(
|
||||
this->HelpMessage.emplace_back(
|
||||
"Welcome to ccmake, curses based user interface for CMake.");
|
||||
this->HelpMessage.push_back("");
|
||||
this->HelpMessage.push_back(s_ConstHelpMessage);
|
||||
this->HelpMessage.emplace_back();
|
||||
this->HelpMessage.emplace_back(s_ConstHelpMessage);
|
||||
this->CMakeInstance = new cmake(cmake::RoleProject, cmState::Project);
|
||||
this->CMakeInstance->SetCMakeEditCommand(
|
||||
cmSystemTools::GetCMakeCursesCommand());
|
||||
@@ -652,7 +652,7 @@ int cmCursesMainForm::Generate()
|
||||
|
||||
void cmCursesMainForm::AddError(const char* message, const char* /*unused*/)
|
||||
{
|
||||
this->Errors.push_back(message);
|
||||
this->Errors.emplace_back(message);
|
||||
}
|
||||
|
||||
void cmCursesMainForm::RemoveEntry(const char* value)
|
||||
|
||||
@@ -181,7 +181,7 @@ void CCONV cmAddExecutable(void* arg, const char* exename, int numSrcs,
|
||||
std::vector<std::string> srcs2;
|
||||
int i;
|
||||
for (i = 0; i < numSrcs; ++i) {
|
||||
srcs2.push_back(srcs[i]);
|
||||
srcs2.emplace_back(srcs[i]);
|
||||
}
|
||||
cmTarget* tg = mf->AddExecutable(exename, srcs2);
|
||||
if (win32) {
|
||||
@@ -393,7 +393,7 @@ void CCONV cmAddLibrary(void* arg, const char* libname, int shared,
|
||||
std::vector<std::string> srcs2;
|
||||
int i;
|
||||
for (i = 0; i < numSrcs; ++i) {
|
||||
srcs2.push_back(srcs[i]);
|
||||
srcs2.emplace_back(srcs[i]);
|
||||
}
|
||||
mf->AddLibrary(
|
||||
libname,
|
||||
@@ -419,8 +419,7 @@ int CCONV cmExecuteCommand(void* arg, const char* name, int numArgs,
|
||||
lff.Name = name;
|
||||
for (int i = 0; i < numArgs; ++i) {
|
||||
// Assume all arguments are quoted.
|
||||
lff.Arguments.push_back(
|
||||
cmListFileArgument(args[i], cmListFileArgument::Quoted, 0));
|
||||
lff.Arguments.emplace_back(args[i], cmListFileArgument::Quoted, 0);
|
||||
}
|
||||
cmExecutionStatus status;
|
||||
return mf->ExecuteCommand(lff, status);
|
||||
@@ -436,7 +435,7 @@ void CCONV cmExpandSourceListArguments(void* arg, int numArgs,
|
||||
std::vector<std::string> result;
|
||||
int i;
|
||||
for (i = 0; i < numArgs; ++i) {
|
||||
result.push_back(args[i]);
|
||||
result.emplace_back(args[i]);
|
||||
}
|
||||
int resargc = static_cast<int>(result.size());
|
||||
char** resargv = nullptr;
|
||||
@@ -627,7 +626,7 @@ void CCONV cmSourceFileAddDepend(void* arg, const char* depend)
|
||||
if (cmSourceFile* rsf = sf->RealSourceFile) {
|
||||
rsf->AddDepend(depend);
|
||||
} else {
|
||||
sf->Depends.push_back(depend);
|
||||
sf->Depends.emplace_back(depend);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -647,10 +646,10 @@ void CCONV cmSourceFileSetName(void* arg, const char* name, const char* dir,
|
||||
std::vector<std::string> headerExts;
|
||||
int i;
|
||||
for (i = 0; i < numSourceExtensions; ++i) {
|
||||
sourceExts.push_back(sourceExtensions[i]);
|
||||
sourceExts.emplace_back(sourceExtensions[i]);
|
||||
}
|
||||
for (i = 0; i < numHeaderExtensions; ++i) {
|
||||
headerExts.push_back(headerExtensions[i]);
|
||||
headerExts.emplace_back(headerExtensions[i]);
|
||||
}
|
||||
|
||||
// Save the original name given.
|
||||
|
||||
+3
-3
@@ -1176,12 +1176,12 @@ int cmCTest::RunTest(std::vector<const char*> argv, std::string* output,
|
||||
if (strcmp(i, "--build-generator") == 0 &&
|
||||
timeout != cmCTest::MaxDuration() &&
|
||||
timeout > cmDuration::zero()) {
|
||||
args.push_back("--test-timeout");
|
||||
args.emplace_back("--test-timeout");
|
||||
std::ostringstream msg;
|
||||
msg << cmDurationTo<unsigned int>(timeout);
|
||||
args.push_back(msg.str());
|
||||
}
|
||||
args.push_back(i);
|
||||
args.emplace_back(i);
|
||||
}
|
||||
}
|
||||
if (log) {
|
||||
@@ -2690,7 +2690,7 @@ void cmCTest::SetSpecificTrack(const char* track)
|
||||
|
||||
void cmCTest::AddSubmitFile(Part part, const char* name)
|
||||
{
|
||||
this->Parts[part].SubmitFiles.push_back(name);
|
||||
this->Parts[part].SubmitFiles.emplace_back(name);
|
||||
}
|
||||
|
||||
void cmCTest::AddCTestConfigurationOverwrite(const std::string& overStr)
|
||||
|
||||
@@ -884,12 +884,12 @@ void cmComputeLinkInformation::AddLinkExtension(const char* e, LinkType type)
|
||||
{
|
||||
if (e && *e) {
|
||||
if (type == LinkStatic) {
|
||||
this->StaticLinkExtensions.push_back(e);
|
||||
this->StaticLinkExtensions.emplace_back(e);
|
||||
}
|
||||
if (type == LinkShared) {
|
||||
this->SharedLinkExtensions.push_back(e);
|
||||
this->SharedLinkExtensions.emplace_back(e);
|
||||
}
|
||||
this->LinkExtensions.push_back(e);
|
||||
this->LinkExtensions.emplace_back(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1005,12 +1005,12 @@ void cmCoreTryCompile::FindOutputFile(const std::string& targetName,
|
||||
tmp += config;
|
||||
searchDirs.push_back(std::move(tmp));
|
||||
}
|
||||
searchDirs.push_back("/Debug");
|
||||
searchDirs.emplace_back("/Debug");
|
||||
#if defined(__APPLE__)
|
||||
std::string app = "/Debug/" + targetName + ".app";
|
||||
searchDirs.push_back(std::move(app));
|
||||
#endif
|
||||
searchDirs.push_back("/Development");
|
||||
searchDirs.emplace_back("/Development");
|
||||
|
||||
for (std::string const& sdir : searchDirs) {
|
||||
std::string command = this->BinaryDirectory;
|
||||
|
||||
@@ -68,7 +68,7 @@ void cmDependsJavaParserHelper::AddClassFound(const char* sclass)
|
||||
return;
|
||||
}
|
||||
}
|
||||
this->ClassesFound.push_back(sclass);
|
||||
this->ClassesFound.emplace_back(sclass);
|
||||
}
|
||||
|
||||
void cmDependsJavaParserHelper::AddPackagesImport(const char* sclass)
|
||||
@@ -78,7 +78,7 @@ void cmDependsJavaParserHelper::AddPackagesImport(const char* sclass)
|
||||
return;
|
||||
}
|
||||
}
|
||||
this->PackagesImport.push_back(sclass);
|
||||
this->PackagesImport.emplace_back(sclass);
|
||||
}
|
||||
|
||||
void cmDependsJavaParserHelper::SafePrintMissing(const char* str, int line,
|
||||
|
||||
@@ -54,7 +54,7 @@ bool cmExecuteProcessCommand::InitialPass(std::vector<std::string> const& args,
|
||||
if (args[i] == "COMMAND") {
|
||||
doing_command = true;
|
||||
command_index = cmds.size();
|
||||
cmds.push_back(std::vector<const char*>());
|
||||
cmds.emplace_back();
|
||||
} else if (args[i] == "OUTPUT_VARIABLE") {
|
||||
doing_command = false;
|
||||
if (++i < args.size()) {
|
||||
@@ -327,15 +327,15 @@ bool cmExecuteProcessCommand::InitialPass(std::vector<std::string> const& args,
|
||||
cmsysProcess_GetExitValueByIndex(cp, static_cast<int>(i));
|
||||
char buf[16];
|
||||
sprintf(buf, "%d", exitCode);
|
||||
res.push_back(buf);
|
||||
res.emplace_back(buf);
|
||||
} break;
|
||||
case kwsysProcess_StateByIndex_Exception:
|
||||
res.push_back(cmsysProcess_GetExceptionStringByIndex(
|
||||
res.emplace_back(cmsysProcess_GetExceptionStringByIndex(
|
||||
cp, static_cast<int>(i)));
|
||||
break;
|
||||
case kwsysProcess_StateByIndex_Error:
|
||||
default:
|
||||
res.push_back("Error getting the child return code");
|
||||
res.emplace_back("Error getting the child return code");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -178,13 +178,13 @@ void cmFindCommon::RerootPaths(std::vector<std::string>& paths)
|
||||
cmSystemTools::ExpandListArgument(rootPath, roots);
|
||||
}
|
||||
if (sysrootCompile) {
|
||||
roots.push_back(sysrootCompile);
|
||||
roots.emplace_back(sysrootCompile);
|
||||
}
|
||||
if (sysrootLink) {
|
||||
roots.push_back(sysrootLink);
|
||||
roots.emplace_back(sysrootLink);
|
||||
}
|
||||
if (sysroot) {
|
||||
roots.push_back(sysroot);
|
||||
roots.emplace_back(sysroot);
|
||||
}
|
||||
for (std::string& r : roots) {
|
||||
cmSystemTools::ConvertToUnixSlashes(r);
|
||||
|
||||
@@ -1848,7 +1848,7 @@ private:
|
||||
}
|
||||
for (std::string const& n : this->Names) {
|
||||
if (cmsysString_strncasecmp(fname, n.c_str(), n.length()) == 0) {
|
||||
matches.push_back(fname);
|
||||
matches.emplace_back(fname);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1907,7 +1907,7 @@ private:
|
||||
for (std::string name : this->Names) {
|
||||
name += this->Extension;
|
||||
if (cmsysString_strcasecmp(fname, name.c_str()) == 0) {
|
||||
matches.push_back(fname);
|
||||
matches.emplace_back(fname);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2070,16 +2070,16 @@ bool cmFindPackageCommand::SearchPrefix(std::string const& prefix_in)
|
||||
common.push_back("lib/" + this->LibraryArchitecture);
|
||||
}
|
||||
if (this->UseLib32Paths) {
|
||||
common.push_back("lib32");
|
||||
common.emplace_back("lib32");
|
||||
}
|
||||
if (this->UseLib64Paths) {
|
||||
common.push_back("lib64");
|
||||
common.emplace_back("lib64");
|
||||
}
|
||||
if (this->UseLibx32Paths) {
|
||||
common.push_back("libx32");
|
||||
common.emplace_back("libx32");
|
||||
}
|
||||
common.push_back("lib");
|
||||
common.push_back("share");
|
||||
common.emplace_back("lib");
|
||||
common.emplace_back("share");
|
||||
|
||||
// PREFIX/(lib/ARCH|lib*|share)/cmake/(Foo|foo|FOO).*/
|
||||
{
|
||||
|
||||
@@ -164,7 +164,7 @@ bool cmForEachCommand::InitialPass(std::vector<std::string> const& args,
|
||||
break;
|
||||
}
|
||||
sprintf(buffer, "%d", cc);
|
||||
range.push_back(buffer);
|
||||
range.emplace_back(buffer);
|
||||
if (cc == stop) {
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -20,8 +20,8 @@ std::vector<cmGeneratorExpressionToken> cmGeneratorExpressionLexer::Tokenize(
|
||||
std::vector<cmGeneratorExpressionToken> result;
|
||||
|
||||
if (input.find('$') == std::string::npos) {
|
||||
result.push_back(cmGeneratorExpressionToken(
|
||||
cmGeneratorExpressionToken::Text, input.c_str(), input.size()));
|
||||
result.emplace_back(cmGeneratorExpressionToken::Text, input.c_str(),
|
||||
input.size());
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -319,7 +319,7 @@ std::string cmGeneratorTarget::GetOutputName(
|
||||
props.push_back(configUpper + "_OUTPUT_NAME");
|
||||
}
|
||||
// OUTPUT_NAME
|
||||
props.push_back("OUTPUT_NAME");
|
||||
props.emplace_back("OUTPUT_NAME");
|
||||
|
||||
std::string outName;
|
||||
for (std::string const& p : props) {
|
||||
@@ -988,7 +988,7 @@ std::vector<BT<std::string>> cmGeneratorTarget::GetSourceFilePaths(
|
||||
item.back() == '>') {
|
||||
continue;
|
||||
}
|
||||
files.push_back(item);
|
||||
files.emplace_back(item);
|
||||
}
|
||||
}
|
||||
return files;
|
||||
@@ -3260,7 +3260,7 @@ void processLinkDirectories(
|
||||
// in case projects set the LINK_DIRECTORIES property directly.
|
||||
cmSystemTools::ConvertToUnixSlashes(entryDirectory);
|
||||
if (uniqueDirectories.insert(entryDirectory).second) {
|
||||
directories.push_back(entryDirectory);
|
||||
directories.emplace_back(entryDirectory);
|
||||
if (debugDirectories) {
|
||||
usedDirectories += " * " + entryDirectory + "\n";
|
||||
}
|
||||
@@ -3838,7 +3838,7 @@ std::string cmGeneratorTarget::GetPDBName(const std::string& config) const
|
||||
}
|
||||
|
||||
// PDB_NAME
|
||||
props.push_back("PDB_NAME");
|
||||
props.emplace_back("PDB_NAME");
|
||||
|
||||
for (std::string const& p : props) {
|
||||
if (const char* outName = this->GetProperty(p)) {
|
||||
|
||||
@@ -1761,7 +1761,7 @@ void cmGlobalGenerator::GenerateBuildCommand(
|
||||
bool /*unused*/, int /*unused*/, bool /*unused*/,
|
||||
std::vector<std::string> const& /*unused*/)
|
||||
{
|
||||
makeCommand.push_back(
|
||||
makeCommand.emplace_back(
|
||||
"cmGlobalGenerator::GenerateBuildCommand not implemented");
|
||||
}
|
||||
|
||||
@@ -2313,12 +2313,12 @@ void cmGlobalGenerator::AddGlobalTarget_Package(
|
||||
singleLine.push_back("./CPackConfig.cmake");
|
||||
gti.CommandLines.push_back(std::move(singleLine));
|
||||
if (this->GetPreinstallTargetName()) {
|
||||
gti.Depends.push_back(this->GetPreinstallTargetName());
|
||||
gti.Depends.emplace_back(this->GetPreinstallTargetName());
|
||||
} else {
|
||||
const char* noPackageAll =
|
||||
mf->GetDefinition("CMAKE_SKIP_PACKAGE_ALL_DEPENDENCY");
|
||||
if (!noPackageAll || cmSystemTools::IsOff(noPackageAll)) {
|
||||
gti.Depends.push_back(this->GetAllTargetName());
|
||||
gti.Depends.emplace_back(this->GetAllTargetName());
|
||||
}
|
||||
}
|
||||
targets.push_back(std::move(gti));
|
||||
@@ -2483,12 +2483,12 @@ void cmGlobalGenerator::AddGlobalTarget_Install(
|
||||
gti.UsesTerminal = true;
|
||||
cmCustomCommandLine singleLine;
|
||||
if (this->GetPreinstallTargetName()) {
|
||||
gti.Depends.push_back(this->GetPreinstallTargetName());
|
||||
gti.Depends.emplace_back(this->GetPreinstallTargetName());
|
||||
} else {
|
||||
const char* noall =
|
||||
mf->GetDefinition("CMAKE_SKIP_INSTALL_ALL_DEPENDENCY");
|
||||
if (!noall || cmSystemTools::IsOff(noall)) {
|
||||
gti.Depends.push_back(this->GetAllTargetName());
|
||||
gti.Depends.emplace_back(this->GetAllTargetName());
|
||||
}
|
||||
}
|
||||
if (mf->GetDefinition("CMake_BINARY_DIR") &&
|
||||
|
||||
@@ -550,7 +550,7 @@ bool cmGlobalNinjaGenerator::FindMakeProgram(cmMakefile* mf)
|
||||
this->NinjaCommand = ninjaCommand;
|
||||
std::vector<std::string> command;
|
||||
command.push_back(this->NinjaCommand);
|
||||
command.push_back("--version");
|
||||
command.emplace_back("--version");
|
||||
std::string version;
|
||||
std::string error;
|
||||
if (!cmSystemTools::RunSingleCommand(command, &version, &error, nullptr,
|
||||
@@ -681,12 +681,12 @@ void cmGlobalNinjaGenerator::GenerateBuildCommand(
|
||||
makeCommand.push_back(this->SelectMakeProgram(makeProgram));
|
||||
|
||||
if (verbose) {
|
||||
makeCommand.push_back("-v");
|
||||
makeCommand.emplace_back("-v");
|
||||
}
|
||||
|
||||
if ((jobs != cmake::NO_BUILD_PARALLEL_LEVEL) &&
|
||||
(jobs != cmake::DEFAULT_BUILD_PARALLEL_LEVEL)) {
|
||||
makeCommand.push_back("-j");
|
||||
makeCommand.emplace_back("-j");
|
||||
makeCommand.push_back(std::to_string(jobs));
|
||||
}
|
||||
|
||||
@@ -694,8 +694,8 @@ void cmGlobalNinjaGenerator::GenerateBuildCommand(
|
||||
makeOptions.end());
|
||||
if (!targetName.empty()) {
|
||||
if (targetName == "clean") {
|
||||
makeCommand.push_back("-t");
|
||||
makeCommand.push_back("clean");
|
||||
makeCommand.emplace_back("-t");
|
||||
makeCommand.emplace_back("clean");
|
||||
} else {
|
||||
makeCommand.push_back(targetName);
|
||||
}
|
||||
|
||||
@@ -216,7 +216,7 @@ void cmGlobalUnixMakefileGenerator3::WriteMainMakefile2()
|
||||
// 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.
|
||||
lg->WriteMakeRule(makefileStream,
|
||||
@@ -513,7 +513,7 @@ void cmGlobalUnixMakefileGenerator3::GenerateBuildCommand(
|
||||
makeCommand.push_back(this->SelectMakeProgram(makeProgram));
|
||||
|
||||
if (jobs != cmake::NO_BUILD_PARALLEL_LEVEL) {
|
||||
makeCommand.push_back("-j");
|
||||
makeCommand.emplace_back("-j");
|
||||
if (jobs != cmake::DEFAULT_BUILD_PARALLEL_LEVEL) {
|
||||
makeCommand.push_back(std::to_string(jobs));
|
||||
}
|
||||
@@ -542,7 +542,7 @@ void cmGlobalUnixMakefileGenerator3::WriteConvenienceRules(
|
||||
|
||||
bool regenerate = !this->GlobalSettingIsOn("CMAKE_SUPPRESS_REGENERATION");
|
||||
if (regenerate) {
|
||||
depends.push_back("cmake_check_build_system");
|
||||
depends.emplace_back("cmake_check_build_system");
|
||||
}
|
||||
|
||||
// write the target convenience rules
|
||||
@@ -577,7 +577,7 @@ void cmGlobalUnixMakefileGenerator3::WriteConvenienceRules(
|
||||
commands.push_back(lg->GetRecursiveMakeCall(tmp.c_str(), name));
|
||||
depends.clear();
|
||||
if (regenerate) {
|
||||
depends.push_back("cmake_check_build_system");
|
||||
depends.emplace_back("cmake_check_build_system");
|
||||
}
|
||||
lg->WriteMakeRule(ruleFileStream, "Build rule for target.", name,
|
||||
depends, commands, true);
|
||||
@@ -631,7 +631,7 @@ void cmGlobalUnixMakefileGenerator3::WriteConvenienceRules2(
|
||||
|
||||
bool regenerate = !this->GlobalSettingIsOn("CMAKE_SUPPRESS_REGENERATION");
|
||||
if (regenerate) {
|
||||
depends.push_back("cmake_check_build_system");
|
||||
depends.emplace_back("cmake_check_build_system");
|
||||
}
|
||||
|
||||
// for each target Generate the rule files for each target.
|
||||
@@ -740,7 +740,7 @@ void cmGlobalUnixMakefileGenerator3::WriteConvenienceRules2(
|
||||
}
|
||||
depends.clear();
|
||||
if (regenerate) {
|
||||
depends.push_back("cmake_check_build_system");
|
||||
depends.emplace_back("cmake_check_build_system");
|
||||
}
|
||||
localName = lg->GetRelativeTargetDirectory(gtarget);
|
||||
localName += "/rule";
|
||||
|
||||
@@ -329,14 +329,14 @@ void cmGlobalXCodeGenerator::GenerateBuildCommand(
|
||||
int jobs, bool /*verbose*/, std::vector<std::string> const& makeOptions)
|
||||
{
|
||||
// now build the test
|
||||
makeCommand.push_back(
|
||||
makeCommand.emplace_back(
|
||||
this->SelectMakeProgram(makeProgram, this->GetXcodeBuildCommand()));
|
||||
|
||||
makeCommand.push_back("-project");
|
||||
makeCommand.emplace_back("-project");
|
||||
std::string projectArg = projectName;
|
||||
projectArg += ".xcode";
|
||||
projectArg += "proj";
|
||||
makeCommand.push_back(projectArg);
|
||||
makeCommand.emplace_back(projectArg);
|
||||
|
||||
bool clean = false;
|
||||
std::string realTarget = targetName;
|
||||
@@ -345,23 +345,23 @@ void cmGlobalXCodeGenerator::GenerateBuildCommand(
|
||||
realTarget = "ALL_BUILD";
|
||||
}
|
||||
if (clean) {
|
||||
makeCommand.push_back("clean");
|
||||
makeCommand.emplace_back("clean");
|
||||
} else {
|
||||
makeCommand.push_back("build");
|
||||
makeCommand.emplace_back("build");
|
||||
}
|
||||
makeCommand.push_back("-target");
|
||||
makeCommand.emplace_back("-target");
|
||||
if (!realTarget.empty()) {
|
||||
makeCommand.push_back(realTarget);
|
||||
makeCommand.emplace_back(realTarget);
|
||||
} else {
|
||||
makeCommand.push_back("ALL_BUILD");
|
||||
makeCommand.emplace_back("ALL_BUILD");
|
||||
}
|
||||
makeCommand.push_back("-configuration");
|
||||
makeCommand.push_back(!config.empty() ? config : "Debug");
|
||||
makeCommand.emplace_back("-configuration");
|
||||
makeCommand.emplace_back(!config.empty() ? config : "Debug");
|
||||
|
||||
if (jobs != cmake::NO_BUILD_PARALLEL_LEVEL) {
|
||||
makeCommand.push_back("-jobs");
|
||||
makeCommand.emplace_back("-jobs");
|
||||
if (jobs != cmake::DEFAULT_BUILD_PARALLEL_LEVEL) {
|
||||
makeCommand.push_back(std::to_string(jobs));
|
||||
makeCommand.emplace_back(std::to_string(jobs));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1051,7 +1051,7 @@ void cmGlobalXCodeGenerator::SetCurrentLocalGenerator(cmLocalGenerator* gen)
|
||||
this->CurrentConfigurationTypes.clear();
|
||||
this->CurrentMakefile->GetConfigurations(this->CurrentConfigurationTypes);
|
||||
if (this->CurrentConfigurationTypes.empty()) {
|
||||
this->CurrentConfigurationTypes.push_back("");
|
||||
this->CurrentConfigurationTypes.emplace_back();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ std::vector<std::string> getConfigurations(const cmake* cm)
|
||||
|
||||
makefiles[0]->GetConfigurations(configurations);
|
||||
if (configurations.empty()) {
|
||||
configurations.push_back("");
|
||||
configurations.emplace_back();
|
||||
}
|
||||
return configurations;
|
||||
}
|
||||
@@ -292,10 +292,10 @@ static Json::Value DumpSourceFilesList(
|
||||
lg->AppendIncludeDirectories(includes, evaluatedIncludes, *file);
|
||||
|
||||
for (const auto& include : includes) {
|
||||
fileData.IncludePathList.push_back(
|
||||
std::make_pair(include,
|
||||
target->IsSystemIncludeDirectory(
|
||||
include, config, fileData.Language)));
|
||||
fileData.IncludePathList.emplace_back(
|
||||
include,
|
||||
target->IsSystemIncludeDirectory(include, config,
|
||||
fileData.Language));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -580,8 +580,8 @@ static Json::Value DumpTarget(cmGeneratorTarget* target,
|
||||
std::vector<std::string> includePathList;
|
||||
lg->GetIncludeDirectories(includePathList, target, lang, config, true);
|
||||
for (std::string const& i : includePathList) {
|
||||
ld.IncludePathList.push_back(
|
||||
std::make_pair(i, target->IsSystemIncludeDirectory(i, config, lang)));
|
||||
ld.IncludePathList.emplace_back(
|
||||
i, target->IsSystemIncludeDirectory(i, config, lang));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+11
-11
@@ -1684,19 +1684,19 @@ void cmLocalGenerator::AddCompilerRequirementFlag(
|
||||
static std::map<std::string, std::vector<std::string>> langStdMap;
|
||||
if (langStdMap.empty()) {
|
||||
// Maintain sorted order, most recent first.
|
||||
langStdMap["CXX"].push_back("20");
|
||||
langStdMap["CXX"].push_back("17");
|
||||
langStdMap["CXX"].push_back("14");
|
||||
langStdMap["CXX"].push_back("11");
|
||||
langStdMap["CXX"].push_back("98");
|
||||
langStdMap["CXX"].emplace_back("20");
|
||||
langStdMap["CXX"].emplace_back("17");
|
||||
langStdMap["CXX"].emplace_back("14");
|
||||
langStdMap["CXX"].emplace_back("11");
|
||||
langStdMap["CXX"].emplace_back("98");
|
||||
|
||||
langStdMap["C"].push_back("11");
|
||||
langStdMap["C"].push_back("99");
|
||||
langStdMap["C"].push_back("90");
|
||||
langStdMap["C"].emplace_back("11");
|
||||
langStdMap["C"].emplace_back("99");
|
||||
langStdMap["C"].emplace_back("90");
|
||||
|
||||
langStdMap["CUDA"].push_back("14");
|
||||
langStdMap["CUDA"].push_back("11");
|
||||
langStdMap["CUDA"].push_back("98");
|
||||
langStdMap["CUDA"].emplace_back("14");
|
||||
langStdMap["CUDA"].emplace_back("11");
|
||||
langStdMap["CUDA"].emplace_back("98");
|
||||
}
|
||||
|
||||
std::string standard(standardProp);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1507,7 +1507,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 +1571,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 +1593,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 +1643,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 +1656,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));
|
||||
|
||||
@@ -94,7 +94,7 @@ bool cmMacroHelperCommand::InvokeInitialPass(
|
||||
char argvName[60];
|
||||
for (unsigned int j = 0; j < expandedArgs.size(); ++j) {
|
||||
sprintf(argvName, "${ARGV%u}", j);
|
||||
argVs.push_back(argvName);
|
||||
argVs.emplace_back(argvName);
|
||||
}
|
||||
// Invoke all the functions that were collected in the block.
|
||||
cmListFileFunction newLFF;
|
||||
|
||||
@@ -2099,7 +2099,7 @@ void cmMakefile::AddSourceGroup(const std::vector<std::string>& name,
|
||||
if (i == -1) {
|
||||
// group does not exist nor belong to any existing group
|
||||
// add its first component
|
||||
this->SourceGroups.push_back(cmSourceGroup(name[0], regex));
|
||||
this->SourceGroups.emplace_back(name[0], regex);
|
||||
sg = this->GetSourceGroup(currentName);
|
||||
i = 0; // last component found
|
||||
}
|
||||
|
||||
@@ -816,7 +816,7 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile(
|
||||
lang_has_assembly && this->LocalGenerator->GetCreateAssemblySourceRules();
|
||||
if (do_preprocess_rules || do_assembly_rules) {
|
||||
std::vector<std::string> force_depends;
|
||||
force_depends.push_back("cmake_force");
|
||||
force_depends.emplace_back("cmake_force");
|
||||
std::string::size_type dot_pos = relativeObj.rfind('.');
|
||||
std::string relativeObjBase = relativeObj.substr(0, dot_pos);
|
||||
dot_pos = obj.rfind('.');
|
||||
|
||||
@@ -377,7 +377,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkRule(bool useResponseFile)
|
||||
cmEraseIf(linkCmds, cmNinjaRemoveNoOpCommands());
|
||||
|
||||
linkCmds.insert(linkCmds.begin(), "$PRE_LINK");
|
||||
linkCmds.push_back("$POST_BUILD");
|
||||
linkCmds.emplace_back("$POST_BUILD");
|
||||
std::string linkCmd =
|
||||
this->GetLocalGenerator()->BuildCommandLine(linkCmds);
|
||||
|
||||
@@ -405,7 +405,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkRule(bool useResponseFile)
|
||||
std::vector<std::string> commandLines;
|
||||
commandLines.push_back(cmakeCommand +
|
||||
" -E cmake_symlink_executable $in $out");
|
||||
commandLines.push_back("$POST_BUILD");
|
||||
commandLines.emplace_back("$POST_BUILD");
|
||||
|
||||
this->GetGlobalGenerator()->AddRule(
|
||||
"CMAKE_SYMLINK_EXECUTABLE",
|
||||
@@ -423,7 +423,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkRule(bool useResponseFile)
|
||||
std::vector<std::string> commandLines;
|
||||
commandLines.push_back(cmakeCommand +
|
||||
" -E cmake_symlink_library $in $SONAME $out");
|
||||
commandLines.push_back("$POST_BUILD");
|
||||
commandLines.emplace_back("$POST_BUILD");
|
||||
|
||||
this->GetGlobalGenerator()->AddRule(
|
||||
"CMAKE_SYMLINK_LIBRARY",
|
||||
|
||||
@@ -151,7 +151,7 @@ bool cmParseArgumentsCommand::InitialPass(std::vector<std::string> const& args,
|
||||
cmSystemTools::SetFatalErrorOccured();
|
||||
return true;
|
||||
}
|
||||
list.push_back(arg);
|
||||
list.emplace_back(arg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+13
-13
@@ -198,7 +198,7 @@ bool cmProjectCommand::InitialPass(std::vector<std::string> const& args,
|
||||
return true;
|
||||
}
|
||||
if (haveLanguages && languages.empty()) {
|
||||
languages.push_back("NONE");
|
||||
languages.emplace_back("NONE");
|
||||
}
|
||||
|
||||
cmPolicies::PolicyStatus cmp0048 =
|
||||
@@ -264,22 +264,22 @@ bool cmProjectCommand::InitialPass(std::vector<std::string> const& args,
|
||||
} else if (cmp0048 != cmPolicies::OLD) {
|
||||
// Set project VERSION variables to empty
|
||||
std::vector<std::string> vv;
|
||||
vv.push_back("PROJECT_VERSION");
|
||||
vv.push_back("PROJECT_VERSION_MAJOR");
|
||||
vv.push_back("PROJECT_VERSION_MINOR");
|
||||
vv.push_back("PROJECT_VERSION_PATCH");
|
||||
vv.push_back("PROJECT_VERSION_TWEAK");
|
||||
vv.emplace_back("PROJECT_VERSION");
|
||||
vv.emplace_back("PROJECT_VERSION_MAJOR");
|
||||
vv.emplace_back("PROJECT_VERSION_MINOR");
|
||||
vv.emplace_back("PROJECT_VERSION_PATCH");
|
||||
vv.emplace_back("PROJECT_VERSION_TWEAK");
|
||||
vv.push_back(projectName + "_VERSION");
|
||||
vv.push_back(projectName + "_VERSION_MAJOR");
|
||||
vv.push_back(projectName + "_VERSION_MINOR");
|
||||
vv.push_back(projectName + "_VERSION_PATCH");
|
||||
vv.push_back(projectName + "_VERSION_TWEAK");
|
||||
if (this->Makefile->IsRootMakefile()) {
|
||||
vv.push_back("CMAKE_PROJECT_VERSION");
|
||||
vv.push_back("CMAKE_PROJECT_VERSION_MAJOR");
|
||||
vv.push_back("CMAKE_PROJECT_VERSION_MINOR");
|
||||
vv.push_back("CMAKE_PROJECT_VERSION_PATCH");
|
||||
vv.push_back("CMAKE_PROJECT_VERSION_TWEAK");
|
||||
vv.emplace_back("CMAKE_PROJECT_VERSION");
|
||||
vv.emplace_back("CMAKE_PROJECT_VERSION_MAJOR");
|
||||
vv.emplace_back("CMAKE_PROJECT_VERSION_MINOR");
|
||||
vv.emplace_back("CMAKE_PROJECT_VERSION_PATCH");
|
||||
vv.emplace_back("CMAKE_PROJECT_VERSION_TWEAK");
|
||||
}
|
||||
std::string vw;
|
||||
for (std::string const& i : vv) {
|
||||
@@ -315,8 +315,8 @@ bool cmProjectCommand::InitialPass(std::vector<std::string> const& args,
|
||||
|
||||
if (languages.empty()) {
|
||||
// if no language is specified do c and c++
|
||||
languages.push_back("C");
|
||||
languages.push_back("CXX");
|
||||
languages.emplace_back("C");
|
||||
languages.emplace_back("CXX");
|
||||
}
|
||||
this->Makefile->EnableLanguage(languages, false);
|
||||
std::string extraInclude = "CMAKE_PROJECT_" + projectName + "_INCLUDE";
|
||||
|
||||
@@ -1482,7 +1482,7 @@ std::pair<bool, std::string> GetQtExecutable(
|
||||
if (cmSystemTools::FileExists(result, true)) {
|
||||
std::vector<std::string> command;
|
||||
command.push_back(result);
|
||||
command.push_back("-h");
|
||||
command.emplace_back("-h");
|
||||
std::string stdOut;
|
||||
std::string stdErr;
|
||||
int retVal = 0;
|
||||
@@ -1546,9 +1546,9 @@ bool cmQtAutoGenInitializer::GetRccExecutable()
|
||||
|
||||
if (this->QtVersion.Major == 5 || this->QtVersion.Major == 6) {
|
||||
if (stdOut.find("--list") != std::string::npos) {
|
||||
this->Rcc.ListOptions.push_back("--list");
|
||||
this->Rcc.ListOptions.emplace_back("--list");
|
||||
} else {
|
||||
this->Rcc.ListOptions.push_back("-list");
|
||||
this->Rcc.ListOptions.emplace_back("-list");
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -844,10 +844,10 @@ void cmQtAutoGeneratorMocUic::JobMocT::GenerateMoc(WorkerT& wrk)
|
||||
wrk.Moc().AllOptions.end());
|
||||
// Add predefs include
|
||||
if (!wrk.Moc().PredefsFileAbs.empty()) {
|
||||
cmd.push_back("--include");
|
||||
cmd.emplace_back("--include");
|
||||
cmd.push_back(wrk.Moc().PredefsFileAbs);
|
||||
}
|
||||
cmd.push_back("-o");
|
||||
cmd.emplace_back("-o");
|
||||
cmd.push_back(BuildFile);
|
||||
cmd.push_back(SourceFile);
|
||||
|
||||
@@ -963,7 +963,7 @@ void cmQtAutoGeneratorMocUic::JobUicT::GenerateUic(WorkerT& wrk)
|
||||
}
|
||||
cmd.insert(cmd.end(), allOpts.begin(), allOpts.end());
|
||||
}
|
||||
cmd.push_back("-o");
|
||||
cmd.emplace_back("-o");
|
||||
cmd.push_back(BuildFile);
|
||||
cmd.push_back(SourceFile);
|
||||
|
||||
@@ -1288,7 +1288,7 @@ bool cmQtAutoGeneratorMocUic::Init(cmMakefile* makefile)
|
||||
std::string& error) {
|
||||
if (!key.empty()) {
|
||||
if (!exp.empty()) {
|
||||
Moc_.DependFilters.push_back(KeyExpT());
|
||||
Moc_.DependFilters.emplace_back();
|
||||
KeyExpT& filter(Moc_.DependFilters.back());
|
||||
if (filter.Exp.compile(exp)) {
|
||||
filter.Key = key;
|
||||
@@ -1506,7 +1506,7 @@ bool cmQtAutoGeneratorMocUic::Init(cmMakefile* makefile)
|
||||
}
|
||||
// Append framework includes
|
||||
for (std::string const& path : frameworkPaths) {
|
||||
Moc_.Includes.push_back("-F");
|
||||
Moc_.Includes.emplace_back("-F");
|
||||
Moc_.Includes.push_back(path);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -603,7 +603,7 @@ bool cmQtAutoGeneratorRcc::GenerateRcc()
|
||||
std::vector<std::string> cmd;
|
||||
cmd.push_back(RccExecutable_);
|
||||
cmd.insert(cmd.end(), Options_.begin(), Options_.end());
|
||||
cmd.push_back("-o");
|
||||
cmd.emplace_back("-o");
|
||||
cmd.push_back(RccFileOutput_);
|
||||
cmd.push_back(QrcFile_);
|
||||
// We're done here if the process fails to start
|
||||
|
||||
+2
-2
@@ -178,7 +178,7 @@ void cmRST::ProcessLine(std::string const& line)
|
||||
// Record the literal lines to output after whole block.
|
||||
// Ignore the language spec and record the opening line as blank.
|
||||
this->Directive = DirectiveCodeBlock;
|
||||
this->MarkupLines.push_back("");
|
||||
this->MarkupLines.emplace_back();
|
||||
} else if (this->ReplaceDirective.find(line)) {
|
||||
// Record the replace directive content.
|
||||
this->Directive = DirectiveReplace;
|
||||
@@ -221,7 +221,7 @@ void cmRST::ProcessLine(std::string const& line)
|
||||
// Record the literal lines to output after whole block.
|
||||
this->Markup = MarkupNormal;
|
||||
this->Directive = DirectiveLiteralBlock;
|
||||
this->MarkupLines.push_back("");
|
||||
this->MarkupLines.emplace_back();
|
||||
this->OutputLine("", false);
|
||||
}
|
||||
// Print non-markup lines.
|
||||
|
||||
@@ -53,17 +53,17 @@ bool cmSetSourceFilesPropertiesCommand::RunCommand(
|
||||
for (j = propbeg; j != propend; ++j) {
|
||||
// old style allows for specifier before PROPERTIES keyword
|
||||
if (*j == "ABSTRACT") {
|
||||
propertyPairs.push_back("ABSTRACT");
|
||||
propertyPairs.push_back("1");
|
||||
propertyPairs.emplace_back("ABSTRACT");
|
||||
propertyPairs.emplace_back("1");
|
||||
} else if (*j == "WRAP_EXCLUDE") {
|
||||
propertyPairs.push_back("WRAP_EXCLUDE");
|
||||
propertyPairs.push_back("1");
|
||||
propertyPairs.emplace_back("WRAP_EXCLUDE");
|
||||
propertyPairs.emplace_back("1");
|
||||
} else if (*j == "GENERATED") {
|
||||
generated = true;
|
||||
propertyPairs.push_back("GENERATED");
|
||||
propertyPairs.push_back("1");
|
||||
propertyPairs.emplace_back("GENERATED");
|
||||
propertyPairs.emplace_back("1");
|
||||
} else if (*j == "COMPILE_FLAGS") {
|
||||
propertyPairs.push_back("COMPILE_FLAGS");
|
||||
propertyPairs.emplace_back("COMPILE_FLAGS");
|
||||
++j;
|
||||
if (j == propend) {
|
||||
errors = "called with incorrect number of arguments "
|
||||
@@ -72,7 +72,7 @@ bool cmSetSourceFilesPropertiesCommand::RunCommand(
|
||||
}
|
||||
propertyPairs.push_back(*j);
|
||||
} else if (*j == "OBJECT_DEPENDS") {
|
||||
propertyPairs.push_back("OBJECT_DEPENDS");
|
||||
propertyPairs.emplace_back("OBJECT_DEPENDS");
|
||||
++j;
|
||||
if (j == propend) {
|
||||
errors = "called with incorrect number of arguments "
|
||||
|
||||
@@ -19,12 +19,12 @@ bool cmSiteNameCommand::InitialPass(std::vector<std::string> const& args,
|
||||
return false;
|
||||
}
|
||||
std::vector<std::string> paths;
|
||||
paths.push_back("/usr/bsd");
|
||||
paths.push_back("/usr/sbin");
|
||||
paths.push_back("/usr/bin");
|
||||
paths.push_back("/bin");
|
||||
paths.push_back("/sbin");
|
||||
paths.push_back("/usr/local/bin");
|
||||
paths.emplace_back("/usr/bsd");
|
||||
paths.emplace_back("/usr/sbin");
|
||||
paths.emplace_back("/usr/bin");
|
||||
paths.emplace_back("/bin");
|
||||
paths.emplace_back("/sbin");
|
||||
paths.emplace_back("/usr/local/bin");
|
||||
|
||||
const char* cacheValue = this->Makefile->GetDefinition(args[0]);
|
||||
if (cacheValue) {
|
||||
|
||||
@@ -105,7 +105,7 @@ bool addFilesToItsSourceGroups(const std::string& root,
|
||||
tokenizedPath.pop_back();
|
||||
|
||||
if (tokenizedPath.empty()) {
|
||||
tokenizedPath.push_back("");
|
||||
tokenizedPath.emplace_back();
|
||||
}
|
||||
|
||||
sg = makefile.GetOrCreateSourceGroup(tokenizedPath);
|
||||
|
||||
@@ -85,10 +85,12 @@ void cmStringReplaceHelper::ParseReplaceExpression()
|
||||
auto r = this->ReplaceExpression.find('\\', l);
|
||||
if (r == std::string::npos) {
|
||||
r = this->ReplaceExpression.length();
|
||||
this->Replacements.push_back(this->ReplaceExpression.substr(l, r - l));
|
||||
this->Replacements.emplace_back(
|
||||
this->ReplaceExpression.substr(l, r - l));
|
||||
} else {
|
||||
if (r - l > 0) {
|
||||
this->Replacements.push_back(this->ReplaceExpression.substr(l, r - l));
|
||||
this->Replacements.emplace_back(
|
||||
this->ReplaceExpression.substr(l, r - l));
|
||||
}
|
||||
if (r == (this->ReplaceExpression.length() - 1)) {
|
||||
this->ValidReplaceExpression = false;
|
||||
@@ -97,11 +99,11 @@ void cmStringReplaceHelper::ParseReplaceExpression()
|
||||
}
|
||||
if ((this->ReplaceExpression[r + 1] >= '0') &&
|
||||
(this->ReplaceExpression[r + 1] <= '9')) {
|
||||
this->Replacements.push_back(this->ReplaceExpression[r + 1] - '0');
|
||||
this->Replacements.emplace_back(this->ReplaceExpression[r + 1] - '0');
|
||||
} else if (this->ReplaceExpression[r + 1] == 'n') {
|
||||
this->Replacements.push_back("\n");
|
||||
this->Replacements.emplace_back("\n");
|
||||
} else if (this->ReplaceExpression[r + 1] == '\\') {
|
||||
this->Replacements.push_back("\\");
|
||||
this->Replacements.emplace_back("\\");
|
||||
} else {
|
||||
this->ValidReplaceExpression = false;
|
||||
std::ostringstream error;
|
||||
|
||||
@@ -534,7 +534,7 @@ public:
|
||||
void Store(std::vector<std::string>& args) const
|
||||
{
|
||||
for (char** arg = this->ArgV; arg && *arg; ++arg) {
|
||||
args.push_back(*arg);
|
||||
args.emplace_back(*arg);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1586,7 +1586,7 @@ std::vector<std::string> cmSystemTools::GetEnvironmentVariables()
|
||||
std::vector<std::string> env;
|
||||
int cc;
|
||||
for (cc = 0; environ[cc]; ++cc) {
|
||||
env.push_back(environ[cc]);
|
||||
env.emplace_back(environ[cc]);
|
||||
}
|
||||
return env;
|
||||
}
|
||||
@@ -3063,7 +3063,7 @@ std::vector<std::string> cmSystemTools::tokenize(const std::string& str,
|
||||
} while (tokend != std::string::npos);
|
||||
|
||||
if (tokens.empty()) {
|
||||
tokens.push_back("");
|
||||
tokens.emplace_back();
|
||||
}
|
||||
return tokens;
|
||||
}
|
||||
|
||||
+17
-17
@@ -731,7 +731,7 @@ bool cmTarget::PushTLLCommandTrace(TLLSignature signature,
|
||||
}
|
||||
}
|
||||
if (this->TLLCommands.empty() || this->TLLCommands.back().second != lfc) {
|
||||
this->TLLCommands.push_back(std::make_pair(signature, lfc));
|
||||
this->TLLCommands.emplace_back(signature, lfc);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@@ -975,7 +975,7 @@ void cmTarget::SetProperty(const std::string& prop, const char* value)
|
||||
this->Internal->IncludeDirectoriesEntries.clear();
|
||||
this->Internal->IncludeDirectoriesBacktraces.clear();
|
||||
if (value) {
|
||||
this->Internal->IncludeDirectoriesEntries.push_back(value);
|
||||
this->Internal->IncludeDirectoriesEntries.emplace_back(value);
|
||||
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
|
||||
this->Internal->IncludeDirectoriesBacktraces.push_back(lfbt);
|
||||
}
|
||||
@@ -983,7 +983,7 @@ void cmTarget::SetProperty(const std::string& prop, const char* value)
|
||||
this->Internal->CompileOptionsEntries.clear();
|
||||
this->Internal->CompileOptionsBacktraces.clear();
|
||||
if (value) {
|
||||
this->Internal->CompileOptionsEntries.push_back(value);
|
||||
this->Internal->CompileOptionsEntries.emplace_back(value);
|
||||
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
|
||||
this->Internal->CompileOptionsBacktraces.push_back(lfbt);
|
||||
}
|
||||
@@ -991,7 +991,7 @@ void cmTarget::SetProperty(const std::string& prop, const char* value)
|
||||
this->Internal->CompileFeaturesEntries.clear();
|
||||
this->Internal->CompileFeaturesBacktraces.clear();
|
||||
if (value) {
|
||||
this->Internal->CompileFeaturesEntries.push_back(value);
|
||||
this->Internal->CompileFeaturesEntries.emplace_back(value);
|
||||
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
|
||||
this->Internal->CompileFeaturesBacktraces.push_back(lfbt);
|
||||
}
|
||||
@@ -999,7 +999,7 @@ void cmTarget::SetProperty(const std::string& prop, const char* value)
|
||||
this->Internal->CompileDefinitionsEntries.clear();
|
||||
this->Internal->CompileDefinitionsBacktraces.clear();
|
||||
if (value) {
|
||||
this->Internal->CompileDefinitionsEntries.push_back(value);
|
||||
this->Internal->CompileDefinitionsEntries.emplace_back(value);
|
||||
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
|
||||
this->Internal->CompileDefinitionsBacktraces.push_back(lfbt);
|
||||
}
|
||||
@@ -1007,7 +1007,7 @@ void cmTarget::SetProperty(const std::string& prop, const char* value)
|
||||
this->Internal->LinkOptionsEntries.clear();
|
||||
this->Internal->LinkOptionsBacktraces.clear();
|
||||
if (value) {
|
||||
this->Internal->LinkOptionsEntries.push_back(value);
|
||||
this->Internal->LinkOptionsEntries.emplace_back(value);
|
||||
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
|
||||
this->Internal->LinkOptionsBacktraces.push_back(lfbt);
|
||||
}
|
||||
@@ -1015,7 +1015,7 @@ void cmTarget::SetProperty(const std::string& prop, const char* value)
|
||||
this->Internal->LinkDirectoriesEntries.clear();
|
||||
this->Internal->LinkDirectoriesBacktraces.clear();
|
||||
if (value) {
|
||||
this->Internal->LinkDirectoriesEntries.push_back(value);
|
||||
this->Internal->LinkDirectoriesEntries.emplace_back(value);
|
||||
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
|
||||
this->Internal->LinkDirectoriesBacktraces.push_back(lfbt);
|
||||
}
|
||||
@@ -1024,7 +1024,7 @@ void cmTarget::SetProperty(const std::string& prop, const char* value)
|
||||
this->Internal->LinkImplementationPropertyBacktraces.clear();
|
||||
if (value) {
|
||||
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
|
||||
this->Internal->LinkImplementationPropertyEntries.push_back(value);
|
||||
this->Internal->LinkImplementationPropertyEntries.emplace_back(value);
|
||||
this->Internal->LinkImplementationPropertyBacktraces.push_back(lfbt);
|
||||
}
|
||||
} else if (prop == propSOURCES) {
|
||||
@@ -1032,7 +1032,7 @@ void cmTarget::SetProperty(const std::string& prop, const char* value)
|
||||
this->Internal->SourceBacktraces.clear();
|
||||
if (value) {
|
||||
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
|
||||
this->Internal->SourceEntries.push_back(value);
|
||||
this->Internal->SourceEntries.emplace_back(value);
|
||||
this->Internal->SourceBacktraces.push_back(lfbt);
|
||||
}
|
||||
} else if (prop == propIMPORTED_GLOBAL) {
|
||||
@@ -1102,49 +1102,49 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value,
|
||||
}
|
||||
if (prop == "INCLUDE_DIRECTORIES") {
|
||||
if (value && *value) {
|
||||
this->Internal->IncludeDirectoriesEntries.push_back(value);
|
||||
this->Internal->IncludeDirectoriesEntries.emplace_back(value);
|
||||
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
|
||||
this->Internal->IncludeDirectoriesBacktraces.push_back(lfbt);
|
||||
}
|
||||
} else if (prop == "COMPILE_OPTIONS") {
|
||||
if (value && *value) {
|
||||
this->Internal->CompileOptionsEntries.push_back(value);
|
||||
this->Internal->CompileOptionsEntries.emplace_back(value);
|
||||
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
|
||||
this->Internal->CompileOptionsBacktraces.push_back(lfbt);
|
||||
}
|
||||
} else if (prop == "COMPILE_FEATURES") {
|
||||
if (value && *value) {
|
||||
this->Internal->CompileFeaturesEntries.push_back(value);
|
||||
this->Internal->CompileFeaturesEntries.emplace_back(value);
|
||||
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
|
||||
this->Internal->CompileFeaturesBacktraces.push_back(lfbt);
|
||||
}
|
||||
} else if (prop == "COMPILE_DEFINITIONS") {
|
||||
if (value && *value) {
|
||||
this->Internal->CompileDefinitionsEntries.push_back(value);
|
||||
this->Internal->CompileDefinitionsEntries.emplace_back(value);
|
||||
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
|
||||
this->Internal->CompileDefinitionsBacktraces.push_back(lfbt);
|
||||
}
|
||||
} else if (prop == "LINK_OPTIONS") {
|
||||
if (value && *value) {
|
||||
this->Internal->LinkOptionsEntries.push_back(value);
|
||||
this->Internal->LinkOptionsEntries.emplace_back(value);
|
||||
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
|
||||
this->Internal->LinkOptionsBacktraces.push_back(lfbt);
|
||||
}
|
||||
} else if (prop == "LINK_DIRECTORIES") {
|
||||
if (value && *value) {
|
||||
this->Internal->LinkDirectoriesEntries.push_back(value);
|
||||
this->Internal->LinkDirectoriesEntries.emplace_back(value);
|
||||
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
|
||||
this->Internal->LinkDirectoriesBacktraces.push_back(lfbt);
|
||||
}
|
||||
} else if (prop == "LINK_LIBRARIES") {
|
||||
if (value && *value) {
|
||||
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
|
||||
this->Internal->LinkImplementationPropertyEntries.push_back(value);
|
||||
this->Internal->LinkImplementationPropertyEntries.emplace_back(value);
|
||||
this->Internal->LinkImplementationPropertyBacktraces.push_back(lfbt);
|
||||
}
|
||||
} else if (prop == "SOURCES") {
|
||||
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
|
||||
this->Internal->SourceEntries.push_back(value);
|
||||
this->Internal->SourceEntries.emplace_back(value);
|
||||
this->Internal->SourceBacktraces.push_back(lfbt);
|
||||
} else if (cmHasLiteralPrefix(prop, "IMPORTED_LIBNAME")) {
|
||||
this->Makefile->IssueMessage(MessageType::FATAL_ERROR,
|
||||
|
||||
@@ -101,11 +101,11 @@ bool cmTryRunCommand::InitialPass(std::vector<std::string> const& argv,
|
||||
bool captureRunOutput = false;
|
||||
if (!this->OutputVariable.empty()) {
|
||||
captureRunOutput = true;
|
||||
tryCompile.push_back("OUTPUT_VARIABLE");
|
||||
tryCompile.emplace_back("OUTPUT_VARIABLE");
|
||||
tryCompile.push_back(this->OutputVariable);
|
||||
}
|
||||
if (!this->CompileOutputVariable.empty()) {
|
||||
tryCompile.push_back("OUTPUT_VARIABLE");
|
||||
tryCompile.emplace_back("OUTPUT_VARIABLE");
|
||||
tryCompile.push_back(this->CompileOutputVariable);
|
||||
}
|
||||
if (!this->RunOutputVariable.empty()) {
|
||||
|
||||
+19
-19
@@ -179,31 +179,31 @@ cmake::cmake(Role role, cmState::Mode mode)
|
||||
// these are used to find files when the extension
|
||||
// is not given
|
||||
// The "c" extension MUST precede the "C" extension.
|
||||
this->SourceFileExtensions.push_back("c");
|
||||
this->SourceFileExtensions.push_back("C");
|
||||
this->SourceFileExtensions.emplace_back("c");
|
||||
this->SourceFileExtensions.emplace_back("C");
|
||||
|
||||
this->SourceFileExtensions.push_back("c++");
|
||||
this->SourceFileExtensions.push_back("cc");
|
||||
this->SourceFileExtensions.push_back("cpp");
|
||||
this->SourceFileExtensions.push_back("cxx");
|
||||
this->SourceFileExtensions.push_back("cu");
|
||||
this->SourceFileExtensions.push_back("m");
|
||||
this->SourceFileExtensions.push_back("M");
|
||||
this->SourceFileExtensions.push_back("mm");
|
||||
this->SourceFileExtensions.emplace_back("c++");
|
||||
this->SourceFileExtensions.emplace_back("cc");
|
||||
this->SourceFileExtensions.emplace_back("cpp");
|
||||
this->SourceFileExtensions.emplace_back("cxx");
|
||||
this->SourceFileExtensions.emplace_back("cu");
|
||||
this->SourceFileExtensions.emplace_back("m");
|
||||
this->SourceFileExtensions.emplace_back("M");
|
||||
this->SourceFileExtensions.emplace_back("mm");
|
||||
|
||||
std::copy(this->SourceFileExtensions.begin(),
|
||||
this->SourceFileExtensions.end(),
|
||||
std::inserter(this->SourceFileExtensionsSet,
|
||||
this->SourceFileExtensionsSet.end()));
|
||||
|
||||
this->HeaderFileExtensions.push_back("h");
|
||||
this->HeaderFileExtensions.push_back("hh");
|
||||
this->HeaderFileExtensions.push_back("h++");
|
||||
this->HeaderFileExtensions.push_back("hm");
|
||||
this->HeaderFileExtensions.push_back("hpp");
|
||||
this->HeaderFileExtensions.push_back("hxx");
|
||||
this->HeaderFileExtensions.push_back("in");
|
||||
this->HeaderFileExtensions.push_back("txx");
|
||||
this->HeaderFileExtensions.emplace_back("h");
|
||||
this->HeaderFileExtensions.emplace_back("hh");
|
||||
this->HeaderFileExtensions.emplace_back("h++");
|
||||
this->HeaderFileExtensions.emplace_back("hm");
|
||||
this->HeaderFileExtensions.emplace_back("hpp");
|
||||
this->HeaderFileExtensions.emplace_back("hxx");
|
||||
this->HeaderFileExtensions.emplace_back("in");
|
||||
this->HeaderFileExtensions.emplace_back("txx");
|
||||
|
||||
std::copy(this->HeaderFileExtensions.begin(),
|
||||
this->HeaderFileExtensions.end(),
|
||||
@@ -2485,7 +2485,7 @@ std::vector<std::string> cmake::GetDebugConfigs()
|
||||
}
|
||||
// If no configurations were specified, use a default list.
|
||||
if (configs.empty()) {
|
||||
configs.push_back("DEBUG");
|
||||
configs.emplace_back("DEBUG");
|
||||
}
|
||||
return configs;
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@ static int do_command(int ac, char const* const* av)
|
||||
{
|
||||
std::vector<std::string> args;
|
||||
args.reserve(ac - 1);
|
||||
args.push_back(av[0]);
|
||||
args.emplace_back(av[0]);
|
||||
args.insert(args.end(), av + 2, av + ac);
|
||||
return cmcmd::ExecuteCMakeCommand(args);
|
||||
}
|
||||
@@ -288,14 +288,14 @@ int do_cmake(int ac, char const* const* av)
|
||||
return 1;
|
||||
}
|
||||
workingMode = cmake::SCRIPT_MODE;
|
||||
args.push_back(av[i]);
|
||||
args.emplace_back(av[i]);
|
||||
i++;
|
||||
args.push_back(av[i]);
|
||||
args.emplace_back(av[i]);
|
||||
} else if (cmHasLiteralPrefix(av[i], "--find-package")) {
|
||||
workingMode = cmake::FIND_PACKAGE_MODE;
|
||||
args.push_back(av[i]);
|
||||
args.emplace_back(av[i]);
|
||||
} else {
|
||||
args.push_back(av[i]);
|
||||
args.emplace_back(av[i]);
|
||||
}
|
||||
}
|
||||
if (sysinfo) {
|
||||
@@ -386,7 +386,7 @@ static int do_build(int ac, char const* const* av)
|
||||
Doing doing = DoingDir;
|
||||
for (int i = 2; i < ac; ++i) {
|
||||
if (doing == DoingNative) {
|
||||
nativeOptions.push_back(av[i]);
|
||||
nativeOptions.emplace_back(av[i]);
|
||||
} else if ((strcmp(av[i], "-j") == 0) ||
|
||||
(strcmp(av[i], "--parallel") == 0)) {
|
||||
jobs = cmake::DEFAULT_BUILD_PARALLEL_LEVEL;
|
||||
|
||||
+8
-8
@@ -201,7 +201,7 @@ static int HandleTidy(const std::string& runCmd, const std::string& sourceFile,
|
||||
std::vector<std::string> tidy_cmd;
|
||||
cmSystemTools::ExpandListArgument(runCmd, tidy_cmd, true);
|
||||
tidy_cmd.push_back(sourceFile);
|
||||
tidy_cmd.push_back("--");
|
||||
tidy_cmd.emplace_back("--");
|
||||
tidy_cmd.insert(tidy_cmd.end(), orig_cmd.begin(), orig_cmd.end());
|
||||
|
||||
// Run the tidy command line. Capture its stdout and hide its stderr.
|
||||
@@ -228,9 +228,9 @@ static int HandleLWYU(const std::string& runCmd,
|
||||
// Construct the ldd -r -u (link what you use lwyu) command line
|
||||
// ldd -u -r lwuy target
|
||||
std::vector<std::string> lwyu_cmd;
|
||||
lwyu_cmd.push_back("ldd");
|
||||
lwyu_cmd.push_back("-u");
|
||||
lwyu_cmd.push_back("-r");
|
||||
lwyu_cmd.emplace_back("ldd");
|
||||
lwyu_cmd.emplace_back("-u");
|
||||
lwyu_cmd.emplace_back("-r");
|
||||
lwyu_cmd.push_back(runCmd);
|
||||
|
||||
// Run the ldd -u -r command line.
|
||||
@@ -1733,7 +1733,7 @@ bool cmVSLink::Parse(std::vector<std::string>::const_iterator argBeg,
|
||||
}
|
||||
|
||||
if (this->LinkGeneratesManifest) {
|
||||
this->LinkCommand.push_back("/MANIFEST");
|
||||
this->LinkCommand.emplace_back("/MANIFEST");
|
||||
this->LinkCommand.push_back("/MANIFESTFILE:" + this->LinkerManifestFile);
|
||||
}
|
||||
|
||||
@@ -1881,8 +1881,8 @@ int cmVSLink::RunMT(std::string const& out, bool notify)
|
||||
{
|
||||
std::vector<std::string> mtCommand;
|
||||
mtCommand.push_back(this->MtPath.empty() ? "mt" : this->MtPath);
|
||||
mtCommand.push_back("/nologo");
|
||||
mtCommand.push_back("/manifest");
|
||||
mtCommand.emplace_back("/nologo");
|
||||
mtCommand.emplace_back("/manifest");
|
||||
if (this->LinkGeneratesManifest) {
|
||||
mtCommand.push_back(this->LinkerManifestFile);
|
||||
}
|
||||
@@ -1892,7 +1892,7 @@ int cmVSLink::RunMT(std::string const& out, bool notify)
|
||||
if (notify) {
|
||||
// Add an undocumented option that enables a special return
|
||||
// code to notify us when the manifest is modified.
|
||||
mtCommand.push_back("/notify_update");
|
||||
mtCommand.emplace_back("/notify_update");
|
||||
}
|
||||
int mtRet = 0;
|
||||
if (!RunCommand("MT", mtCommand, this->Verbose, FORMAT_HEX, &mtRet,
|
||||
|
||||
+1
-1
@@ -208,7 +208,7 @@ int main(int argc, char const* const* argv)
|
||||
std::vector<std::string> args;
|
||||
args.reserve(argc);
|
||||
for (int i = 0; i < argc; ++i) {
|
||||
args.push_back(argv[i]);
|
||||
args.emplace_back(argv[i]);
|
||||
}
|
||||
// run ctest
|
||||
std::string output;
|
||||
|
||||
Reference in New Issue
Block a user