|
@@ -7,6 +7,7 @@
|
|
|
#include <assert.h>
|
|
#include <assert.h>
|
|
|
#include <errno.h>
|
|
#include <errno.h>
|
|
|
#include <iterator>
|
|
#include <iterator>
|
|
|
|
|
+#include <memory> // IWYU pragma: keep
|
|
|
#include <queue>
|
|
#include <queue>
|
|
|
#include <sstream>
|
|
#include <sstream>
|
|
|
#include <stdio.h>
|
|
#include <stdio.h>
|
|
@@ -32,7 +33,6 @@
|
|
|
#include "cmTarget.h"
|
|
#include "cmTarget.h"
|
|
|
#include "cmTargetLinkLibraryType.h"
|
|
#include "cmTargetLinkLibraryType.h"
|
|
|
#include "cmTargetPropertyComputer.h"
|
|
#include "cmTargetPropertyComputer.h"
|
|
|
-#include "cm_auto_ptr.hxx"
|
|
|
|
|
#include "cmake.h"
|
|
#include "cmake.h"
|
|
|
|
|
|
|
|
class cmMessenger;
|
|
class cmMessenger;
|
|
@@ -64,13 +64,13 @@ class cmGeneratorTarget::TargetPropertyEntry
|
|
|
static cmLinkImplItem NoLinkImplItem;
|
|
static cmLinkImplItem NoLinkImplItem;
|
|
|
|
|
|
|
|
public:
|
|
public:
|
|
|
- TargetPropertyEntry(CM_AUTO_PTR<cmCompiledGeneratorExpression> cge,
|
|
|
|
|
|
|
+ TargetPropertyEntry(std::unique_ptr<cmCompiledGeneratorExpression> cge,
|
|
|
cmLinkImplItem const& item = NoLinkImplItem)
|
|
cmLinkImplItem const& item = NoLinkImplItem)
|
|
|
- : ge(cge)
|
|
|
|
|
|
|
+ : ge(std::move(cge))
|
|
|
, LinkImplItem(item)
|
|
, LinkImplItem(item)
|
|
|
{
|
|
{
|
|
|
}
|
|
}
|
|
|
- const CM_AUTO_PTR<cmCompiledGeneratorExpression> ge;
|
|
|
|
|
|
|
+ const std::unique_ptr<cmCompiledGeneratorExpression> ge;
|
|
|
cmLinkImplItem const& LinkImplItem;
|
|
cmLinkImplItem const& LinkImplItem;
|
|
|
};
|
|
};
|
|
|
cmLinkImplItem cmGeneratorTarget::TargetPropertyEntry::NoLinkImplItem;
|
|
cmLinkImplItem cmGeneratorTarget::TargetPropertyEntry::NoLinkImplItem;
|
|
@@ -84,9 +84,10 @@ void CreatePropertyGeneratorExpressions(
|
|
|
for (std::vector<std::string>::const_iterator it = entries.begin();
|
|
for (std::vector<std::string>::const_iterator it = entries.begin();
|
|
|
it != entries.end(); ++it, ++btIt) {
|
|
it != entries.end(); ++it, ++btIt) {
|
|
|
cmGeneratorExpression ge(*btIt);
|
|
cmGeneratorExpression ge(*btIt);
|
|
|
- CM_AUTO_PTR<cmCompiledGeneratorExpression> cge = ge.Parse(*it);
|
|
|
|
|
|
|
+ std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(*it);
|
|
|
cge->SetEvaluateForBuildsystem(evaluateForBuildsystem);
|
|
cge->SetEvaluateForBuildsystem(evaluateForBuildsystem);
|
|
|
- items.push_back(new cmGeneratorTarget::TargetPropertyEntry(cge));
|
|
|
|
|
|
|
+ items.push_back(
|
|
|
|
|
+ new cmGeneratorTarget::TargetPropertyEntry(std::move(cge)));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -309,7 +310,7 @@ std::string cmGeneratorTarget::GetOutputName(
|
|
|
|
|
|
|
|
// Now evaluate genex and update the previously-prepared map entry.
|
|
// Now evaluate genex and update the previously-prepared map entry.
|
|
|
cmGeneratorExpression ge;
|
|
cmGeneratorExpression ge;
|
|
|
- CM_AUTO_PTR<cmCompiledGeneratorExpression> cge = ge.Parse(outName);
|
|
|
|
|
|
|
+ std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(outName);
|
|
|
i->second = cge->Evaluate(this->LocalGenerator, config);
|
|
i->second = cge->Evaluate(this->LocalGenerator, config);
|
|
|
} else if (i->second.empty()) {
|
|
} else if (i->second.empty()) {
|
|
|
// An empty map entry indicates we have been called recursively
|
|
// An empty map entry indicates we have been called recursively
|
|
@@ -333,9 +334,9 @@ void cmGeneratorTarget::AddSourceCommon(const std::string& src)
|
|
|
{
|
|
{
|
|
|
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
|
|
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
|
|
|
cmGeneratorExpression ge(lfbt);
|
|
cmGeneratorExpression ge(lfbt);
|
|
|
- CM_AUTO_PTR<cmCompiledGeneratorExpression> cge = ge.Parse(src);
|
|
|
|
|
|
|
+ std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(src);
|
|
|
cge->SetEvaluateForBuildsystem(true);
|
|
cge->SetEvaluateForBuildsystem(true);
|
|
|
- this->SourceEntries.push_back(new TargetPropertyEntry(cge));
|
|
|
|
|
|
|
+ this->SourceEntries.push_back(new TargetPropertyEntry(std::move(cge)));
|
|
|
this->ClearSourcesCache();
|
|
this->ClearSourcesCache();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -359,13 +360,14 @@ void cmGeneratorTarget::AddIncludeDirectory(const std::string& src,
|
|
|
this->Target->InsertInclude(src, this->Makefile->GetBacktrace(), before);
|
|
this->Target->InsertInclude(src, this->Makefile->GetBacktrace(), before);
|
|
|
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
|
|
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
|
|
|
cmGeneratorExpression ge(lfbt);
|
|
cmGeneratorExpression ge(lfbt);
|
|
|
- CM_AUTO_PTR<cmCompiledGeneratorExpression> cge = ge.Parse(src);
|
|
|
|
|
|
|
+ std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(src);
|
|
|
cge->SetEvaluateForBuildsystem(true);
|
|
cge->SetEvaluateForBuildsystem(true);
|
|
|
// Insert before begin/end
|
|
// Insert before begin/end
|
|
|
std::vector<TargetPropertyEntry*>::iterator pos = before
|
|
std::vector<TargetPropertyEntry*>::iterator pos = before
|
|
|
? this->IncludeDirectoriesEntries.begin()
|
|
? this->IncludeDirectoriesEntries.begin()
|
|
|
: this->IncludeDirectoriesEntries.end();
|
|
: this->IncludeDirectoriesEntries.end();
|
|
|
- this->IncludeDirectoriesEntries.insert(pos, new TargetPropertyEntry(cge));
|
|
|
|
|
|
|
+ this->IncludeDirectoriesEntries.insert(
|
|
|
|
|
+ pos, new TargetPropertyEntry(std::move(cge)));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
std::vector<cmSourceFile*> const* cmGeneratorTarget::GetSourceDepends(
|
|
std::vector<cmSourceFile*> const* cmGeneratorTarget::GetSourceDepends(
|
|
@@ -795,10 +797,10 @@ static void AddInterfaceEntries(
|
|
|
if (lib.Target) {
|
|
if (lib.Target) {
|
|
|
std::string genex = "$<TARGET_PROPERTY:" + lib + "," + prop + ">";
|
|
std::string genex = "$<TARGET_PROPERTY:" + lib + "," + prop + ">";
|
|
|
cmGeneratorExpression ge(lib.Backtrace);
|
|
cmGeneratorExpression ge(lib.Backtrace);
|
|
|
- CM_AUTO_PTR<cmCompiledGeneratorExpression> cge = ge.Parse(genex);
|
|
|
|
|
|
|
+ std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(genex);
|
|
|
cge->SetEvaluateForBuildsystem(true);
|
|
cge->SetEvaluateForBuildsystem(true);
|
|
|
entries.push_back(
|
|
entries.push_back(
|
|
|
- new cmGeneratorTarget::TargetPropertyEntry(cge, lib));
|
|
|
|
|
|
|
+ new cmGeneratorTarget::TargetPropertyEntry(std::move(cge), lib));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -2285,7 +2287,7 @@ void cmTargetTraceDependencies::CheckCustomCommand(cmCustomCommand const& cc)
|
|
|
|
|
|
|
|
// Check for target references in generator expressions.
|
|
// Check for target references in generator expressions.
|
|
|
for (std::string const& cl : cCmdLine) {
|
|
for (std::string const& cl : cCmdLine) {
|
|
|
- const CM_AUTO_PTR<cmCompiledGeneratorExpression> cge = ge.Parse(cl);
|
|
|
|
|
|
|
+ const std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(cl);
|
|
|
cge->Evaluate(this->GeneratorTarget->GetLocalGenerator(), "", true);
|
|
cge->Evaluate(this->GeneratorTarget->GetLocalGenerator(), "", true);
|
|
|
std::set<cmGeneratorTarget*> geTargets = cge->GetTargets();
|
|
std::set<cmGeneratorTarget*> geTargets = cge->GetTargets();
|
|
|
targets.insert(geTargets.begin(), geTargets.end());
|
|
targets.insert(geTargets.begin(), geTargets.end());
|
|
@@ -2570,10 +2572,10 @@ std::vector<std::string> cmGeneratorTarget::GetIncludeDirectories(
|
|
|
libDir = frameworkCheck.match(1);
|
|
libDir = frameworkCheck.match(1);
|
|
|
|
|
|
|
|
cmGeneratorExpression ge;
|
|
cmGeneratorExpression ge;
|
|
|
- CM_AUTO_PTR<cmCompiledGeneratorExpression> cge =
|
|
|
|
|
|
|
+ std::unique_ptr<cmCompiledGeneratorExpression> cge =
|
|
|
ge.Parse(libDir.c_str());
|
|
ge.Parse(libDir.c_str());
|
|
|
linkInterfaceIncludeDirectoriesEntries.push_back(
|
|
linkInterfaceIncludeDirectoriesEntries.push_back(
|
|
|
- new cmGeneratorTarget::TargetPropertyEntry(cge));
|
|
|
|
|
|
|
+ new cmGeneratorTarget::TargetPropertyEntry(std::move(cge)));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -2781,10 +2783,10 @@ void cmGeneratorTarget::GetCompileDefinitions(
|
|
|
}
|
|
}
|
|
|
case cmPolicies::OLD: {
|
|
case cmPolicies::OLD: {
|
|
|
cmGeneratorExpression ge;
|
|
cmGeneratorExpression ge;
|
|
|
- CM_AUTO_PTR<cmCompiledGeneratorExpression> cge =
|
|
|
|
|
|
|
+ std::unique_ptr<cmCompiledGeneratorExpression> cge =
|
|
|
ge.Parse(configProp);
|
|
ge.Parse(configProp);
|
|
|
linkInterfaceCompileDefinitionsEntries.push_back(
|
|
linkInterfaceCompileDefinitionsEntries.push_back(
|
|
|
- new cmGeneratorTarget::TargetPropertyEntry(cge));
|
|
|
|
|
|
|
+ new cmGeneratorTarget::TargetPropertyEntry(std::move(cge)));
|
|
|
} break;
|
|
} break;
|
|
|
case cmPolicies::NEW:
|
|
case cmPolicies::NEW:
|
|
|
case cmPolicies::REQUIRED_ALWAYS:
|
|
case cmPolicies::REQUIRED_ALWAYS:
|
|
@@ -4214,7 +4216,7 @@ void cmGeneratorTarget::ExpandLinkItems(
|
|
|
dagChecker.SetTransitivePropertiesOnly();
|
|
dagChecker.SetTransitivePropertiesOnly();
|
|
|
}
|
|
}
|
|
|
std::vector<std::string> libs;
|
|
std::vector<std::string> libs;
|
|
|
- CM_AUTO_PTR<cmCompiledGeneratorExpression> cge = ge.Parse(value);
|
|
|
|
|
|
|
+ std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(value);
|
|
|
cmSystemTools::ExpandListArgument(cge->Evaluate(this->LocalGenerator, config,
|
|
cmSystemTools::ExpandListArgument(cge->Evaluate(this->LocalGenerator, config,
|
|
|
false, headTarget, this,
|
|
false, headTarget, this,
|
|
|
&dagChecker),
|
|
&dagChecker),
|
|
@@ -4484,7 +4486,8 @@ bool cmGeneratorTarget::ComputeOutputDir(const std::string& config,
|
|
|
if (const char* config_outdir = this->GetProperty(configProp)) {
|
|
if (const char* config_outdir = this->GetProperty(configProp)) {
|
|
|
// Use the user-specified per-configuration output directory.
|
|
// Use the user-specified per-configuration output directory.
|
|
|
cmGeneratorExpression ge;
|
|
cmGeneratorExpression ge;
|
|
|
- CM_AUTO_PTR<cmCompiledGeneratorExpression> cge = ge.Parse(config_outdir);
|
|
|
|
|
|
|
+ std::unique_ptr<cmCompiledGeneratorExpression> cge =
|
|
|
|
|
+ ge.Parse(config_outdir);
|
|
|
out = cge->Evaluate(this->LocalGenerator, config);
|
|
out = cge->Evaluate(this->LocalGenerator, config);
|
|
|
|
|
|
|
|
// Skip per-configuration subdirectory.
|
|
// Skip per-configuration subdirectory.
|
|
@@ -4492,7 +4495,7 @@ bool cmGeneratorTarget::ComputeOutputDir(const std::string& config,
|
|
|
} else if (const char* outdir = this->GetProperty(propertyName)) {
|
|
} else if (const char* outdir = this->GetProperty(propertyName)) {
|
|
|
// Use the user-specified output directory.
|
|
// Use the user-specified output directory.
|
|
|
cmGeneratorExpression ge;
|
|
cmGeneratorExpression ge;
|
|
|
- CM_AUTO_PTR<cmCompiledGeneratorExpression> cge = ge.Parse(outdir);
|
|
|
|
|
|
|
+ std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(outdir);
|
|
|
out = cge->Evaluate(this->LocalGenerator, config);
|
|
out = cge->Evaluate(this->LocalGenerator, config);
|
|
|
|
|
|
|
|
// Skip per-configuration subdirectory if the value contained a
|
|
// Skip per-configuration subdirectory if the value contained a
|
|
@@ -5222,7 +5225,7 @@ void cmGeneratorTarget::ComputeLinkImplementationLibraries(
|
|
|
cmGeneratorExpressionDAGChecker dagChecker(
|
|
cmGeneratorExpressionDAGChecker dagChecker(
|
|
|
this->GetName(), "LINK_LIBRARIES", nullptr, nullptr);
|
|
this->GetName(), "LINK_LIBRARIES", nullptr, nullptr);
|
|
|
cmGeneratorExpression ge(*btIt);
|
|
cmGeneratorExpression ge(*btIt);
|
|
|
- CM_AUTO_PTR<cmCompiledGeneratorExpression> const cge = ge.Parse(*le);
|
|
|
|
|
|
|
+ std::unique_ptr<cmCompiledGeneratorExpression> const cge = ge.Parse(*le);
|
|
|
std::string const evaluated =
|
|
std::string const evaluated =
|
|
|
cge->Evaluate(this->LocalGenerator, config, false, head, &dagChecker);
|
|
cge->Evaluate(this->LocalGenerator, config, false, head, &dagChecker);
|
|
|
cmSystemTools::ExpandListArgument(evaluated, llibs);
|
|
cmSystemTools::ExpandListArgument(evaluated, llibs);
|