summaryrefslogtreecommitdiff
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r--Source/cmMakefile.cxx44
1 files changed, 22 insertions, 22 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index bf3e217352..e37632316c 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -1059,9 +1059,8 @@ cmTarget* cmMakefile::AddCustomCommandToTarget(
const std::string& target, const std::vector<std::string>& byproducts,
const std::vector<std::string>& depends,
const cmCustomCommandLines& commandLines, cmCustomCommandType type,
- const char* comment, const char* workingDir,
- cmPolicies::PolicyStatus cmp0116, bool escapeOldStyle, bool uses_terminal,
- const std::string& depfile, const std::string& job_pool,
+ const char* comment, const char* workingDir, bool escapeOldStyle,
+ bool uses_terminal, const std::string& depfile, const std::string& job_pool,
bool command_expand_lists, bool stdPipesUTF8)
{
cmTarget* t = this->GetCustomCommandTarget(
@@ -1075,6 +1074,8 @@ cmTarget* cmMakefile::AddCustomCommandToTarget(
// Always create the byproduct sources and mark them generated.
this->CreateGeneratedOutputs(byproducts);
+ auto cmp0116 = this->GetPolicyStatus(cmPolicies::CMP0116);
+
// Strings could be moved into the callback function with C++14.
cm::optional<std::string> commentStr = MakeOptionalString(comment);
cm::optional<std::string> workingStr = MakeOptionalString(workingDir);
@@ -1097,18 +1098,16 @@ void cmMakefile::AddCustomCommandToOutput(
const std::string& output, const std::vector<std::string>& depends,
const std::string& main_dependency, const cmCustomCommandLines& commandLines,
const char* comment, const char* workingDir,
- cmPolicies::PolicyStatus cmp0116, const CommandSourceCallback& callback,
- bool replace, bool escapeOldStyle, bool uses_terminal,
- bool command_expand_lists, const std::string& depfile,
+ const CommandSourceCallback& callback, bool replace, bool escapeOldStyle,
+ bool uses_terminal, bool command_expand_lists, const std::string& depfile,
const std::string& job_pool, bool stdPipesUTF8)
{
std::vector<std::string> no_byproducts;
cmImplicitDependsList no_implicit_depends;
this->AddCustomCommandToOutput(
{ output }, no_byproducts, depends, main_dependency, no_implicit_depends,
- commandLines, comment, workingDir, cmp0116, callback, replace,
- escapeOldStyle, uses_terminal, command_expand_lists, depfile, job_pool,
- stdPipesUTF8);
+ commandLines, comment, workingDir, callback, replace, escapeOldStyle,
+ uses_terminal, command_expand_lists, depfile, job_pool, stdPipesUTF8);
}
void cmMakefile::AddCustomCommandToOutput(
@@ -1117,10 +1116,9 @@ void cmMakefile::AddCustomCommandToOutput(
const std::vector<std::string>& depends, const std::string& main_dependency,
const cmImplicitDependsList& implicit_depends,
const cmCustomCommandLines& commandLines, const char* comment,
- const char* workingDir, cmPolicies::PolicyStatus cmp0116,
- const CommandSourceCallback& callback, bool replace, bool escapeOldStyle,
- bool uses_terminal, bool command_expand_lists, const std::string& depfile,
- const std::string& job_pool, bool stdPipesUTF8)
+ const char* workingDir, const CommandSourceCallback& callback, bool replace,
+ bool escapeOldStyle, bool uses_terminal, bool command_expand_lists,
+ const std::string& depfile, const std::string& job_pool, bool stdPipesUTF8)
{
// Make sure there is at least one output.
if (outputs.empty()) {
@@ -1137,6 +1135,8 @@ void cmMakefile::AddCustomCommandToOutput(
this->CreateGeneratedOutputs(outputs);
this->CreateGeneratedOutputs(byproducts);
+ auto cmp0116 = this->GetPolicyStatus(cmPolicies::CMP0116);
+
// Strings could be moved into the callback function with C++14.
cm::optional<std::string> commentStr = MakeOptionalString(comment);
cm::optional<std::string> workingStr = MakeOptionalString(workingDir);
@@ -1160,8 +1160,7 @@ void cmMakefile::AddCustomCommandToOutput(
void cmMakefile::AddCustomCommandOldStyle(
const std::string& target, const std::vector<std::string>& outputs,
const std::vector<std::string>& depends, const std::string& source,
- const cmCustomCommandLines& commandLines, const char* comment,
- cmPolicies::PolicyStatus cmp0116)
+ const cmCustomCommandLines& commandLines, const char* comment)
{
// Translate the old-style signature to one of the new-style
// signatures.
@@ -1172,7 +1171,7 @@ void cmMakefile::AddCustomCommandOldStyle(
std::vector<std::string> no_byproducts;
this->AddCustomCommandToTarget(
target, no_byproducts, depends, commandLines,
- cmCustomCommandType::POST_BUILD, comment, nullptr, cmp0116);
+ cmCustomCommandType::POST_BUILD, comment, nullptr);
return;
}
@@ -1205,8 +1204,7 @@ void cmMakefile::AddCustomCommandOldStyle(
// The source looks like a real file. Use it as the main dependency.
for (std::string const& output : outputs) {
this->AddCustomCommandToOutput(output, depends, source, commandLines,
- comment, nullptr, cmp0116,
- addRuleFileToTarget);
+ comment, nullptr, addRuleFileToTarget);
}
} else {
std::string no_main_dependency;
@@ -1216,7 +1214,7 @@ void cmMakefile::AddCustomCommandOldStyle(
// The source may not be a real file. Do not use a main dependency.
for (std::string const& output : outputs) {
this->AddCustomCommandToOutput(output, depends2, no_main_dependency,
- commandLines, comment, nullptr, cmp0116,
+ commandLines, comment, nullptr,
addRuleFileToTarget);
}
}
@@ -1243,9 +1241,9 @@ cmTarget* cmMakefile::AddUtilityCommand(
const std::string& utilityName, bool excludeFromAll, const char* workingDir,
const std::vector<std::string>& byproducts,
const std::vector<std::string>& depends,
- const cmCustomCommandLines& commandLines, cmPolicies::PolicyStatus cmp0116,
- bool escapeOldStyle, const char* comment, bool uses_terminal,
- bool command_expand_lists, const std::string& job_pool, bool stdPipesUTF8)
+ const cmCustomCommandLines& commandLines, bool escapeOldStyle,
+ const char* comment, bool uses_terminal, bool command_expand_lists,
+ const std::string& job_pool, bool stdPipesUTF8)
{
cmTarget* target = this->AddNewUtilityTarget(utilityName, excludeFromAll);
@@ -1258,6 +1256,8 @@ cmTarget* cmMakefile::AddUtilityCommand(
// Always create the byproduct sources and mark them generated.
this->CreateGeneratedOutputs(byproducts);
+ auto cmp0116 = this->GetPolicyStatus(cmPolicies::CMP0116);
+
// Strings could be moved into the callback function with C++14.
cm::optional<std::string> commentStr = MakeOptionalString(comment);
cm::optional<std::string> workingStr = MakeOptionalString(workingDir);