summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorDaniel Eiband <daniel.eiband@brainlab.com>2019-09-20 20:47:50 (GMT)
committerBrad King <brad.king@kitware.com>2019-09-26 14:02:08 (GMT)
commit91abf9f3c4a80f5a8417401d5277b3b66bc7d008 (patch)
treeff61f00c07626d0f2ac3b2b0cf8dedd2802392a0 /Source
parentf151a5770597dbe341fc6329a711f40e9195c773 (diff)
downloadCMake-91abf9f3c4a80f5a8417401d5277b3b66bc7d008.zip
CMake-91abf9f3c4a80f5a8417401d5277b3b66bc7d008.tar.gz
CMake-91abf9f3c4a80f5a8417401d5277b3b66bc7d008.tar.bz2
cmCustomCommand: Move custom commands
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGlobalGenerator.cxx2
-rw-r--r--Source/cmMakefile.cxx6
-rw-r--r--Source/cmQtAutoGenInitializer.cxx2
-rw-r--r--Source/cmTarget.cxx15
-rw-r--r--Source/cmTarget.h3
5 files changed, 23 insertions, 5 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 2273c50..c4974f3 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -2582,7 +2582,7 @@ cmTarget cmGlobalGenerator::CreateGlobalTarget(GlobalTargetInfo const& gti,
cmCustomCommand cc(nullptr, no_outputs, no_byproducts, no_depends,
gti.CommandLines, nullptr, gti.WorkingDir.c_str());
cc.SetUsesTerminal(gti.UsesTerminal);
- target.AddPostBuildCommand(cc);
+ target.AddPostBuildCommand(std::move(cc));
if (!gti.Message.empty()) {
target.SetProperty("EchoString", gti.Message.c_str());
}
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index e53851d..d1235b2 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -938,13 +938,13 @@ void cmMakefile::CommitCustomCommandToTarget(
cc.SetJobPool(job_pool);
switch (type) {
case cmCustomCommandType::PRE_BUILD:
- target->AddPreBuildCommand(cc);
+ target->AddPreBuildCommand(std::move(cc));
break;
case cmCustomCommandType::PRE_LINK:
- target->AddPreLinkCommand(cc);
+ target->AddPreLinkCommand(std::move(cc));
break;
case cmCustomCommandType::POST_BUILD:
- target->AddPostBuildCommand(cc);
+ target->AddPostBuildCommand(std::move(cc));
break;
}
this->UpdateOutputToSourceMap(byproducts, target);
diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx
index 9dbd612..d7b9fa2 100644
--- a/Source/cmQtAutoGenInitializer.cxx
+++ b/Source/cmQtAutoGenInitializer.cxx
@@ -1086,7 +1086,7 @@ bool cmQtAutoGenInitializer::InitAutogenTarget()
this->Dir.Work.c_str());
cc.SetEscapeOldStyle(false);
cc.SetEscapeAllowMakeVars(true);
- this->GenTarget->Target->AddPreBuildCommand(cc);
+ this->GenTarget->Target->AddPreBuildCommand(std::move(cc));
} else {
// Add link library target dependencies to the autogen target
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 1b88db6..ae77d9e 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -604,6 +604,11 @@ void cmTarget::AddPreBuildCommand(cmCustomCommand const& cmd)
impl->PreBuildCommands.push_back(cmd);
}
+void cmTarget::AddPreBuildCommand(cmCustomCommand&& cmd)
+{
+ impl->PreBuildCommands.push_back(std::move(cmd));
+}
+
std::vector<cmCustomCommand> const& cmTarget::GetPreLinkCommands() const
{
return impl->PreLinkCommands;
@@ -614,6 +619,11 @@ void cmTarget::AddPreLinkCommand(cmCustomCommand const& cmd)
impl->PreLinkCommands.push_back(cmd);
}
+void cmTarget::AddPreLinkCommand(cmCustomCommand&& cmd)
+{
+ impl->PreLinkCommands.push_back(std::move(cmd));
+}
+
std::vector<cmCustomCommand> const& cmTarget::GetPostBuildCommands() const
{
return impl->PostBuildCommands;
@@ -624,6 +634,11 @@ void cmTarget::AddPostBuildCommand(cmCustomCommand const& cmd)
impl->PostBuildCommands.push_back(cmd);
}
+void cmTarget::AddPostBuildCommand(cmCustomCommand&& cmd)
+{
+ impl->PostBuildCommands.push_back(std::move(cmd));
+}
+
void cmTarget::AddTracedSources(std::vector<std::string> const& srcs)
{
if (!srcs.empty()) {
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 1b4f23a..65a1ce3 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -84,14 +84,17 @@ public:
//! Get the list of the PRE_BUILD custom commands for this target
std::vector<cmCustomCommand> const& GetPreBuildCommands() const;
void AddPreBuildCommand(cmCustomCommand const& cmd);
+ void AddPreBuildCommand(cmCustomCommand&& cmd);
//! Get the list of the PRE_LINK custom commands for this target
std::vector<cmCustomCommand> const& GetPreLinkCommands() const;
void AddPreLinkCommand(cmCustomCommand const& cmd);
+ void AddPreLinkCommand(cmCustomCommand&& cmd);
//! Get the list of the POST_BUILD custom commands for this target
std::vector<cmCustomCommand> const& GetPostBuildCommands() const;
void AddPostBuildCommand(cmCustomCommand const& cmd);
+ void AddPostBuildCommand(cmCustomCommand&& cmd);
//! Add sources to the target.
void AddSources(std::vector<std::string> const& srcs);