mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-09-28 04:09:35 +03:00
clang-tidy: fix modernize-make-unique lint
This commit is contained in:
@@ -63,8 +63,8 @@ bool cmExportFileGenerator::GenerateImportFile()
|
||||
openmodeApp);
|
||||
} else {
|
||||
// Generate atomically and with copy-if-different.
|
||||
std::unique_ptr<cmGeneratedFileStream> ap(
|
||||
new cmGeneratedFileStream(this->MainImportFile, true));
|
||||
auto ap =
|
||||
cm::make_unique<cmGeneratedFileStream>(this->MainImportFile, true);
|
||||
ap->SetCopyIfDifferent(true);
|
||||
foutPtr = std::move(ap);
|
||||
}
|
||||
|
||||
@@ -3870,11 +3870,11 @@ cmTarget* cmMakefile::AddImportedTarget(std::string const& name,
|
||||
bool global)
|
||||
{
|
||||
// Create the target.
|
||||
std::unique_ptr<cmTarget> target(
|
||||
new cmTarget(name, type,
|
||||
global ? cmTarget::Visibility::ImportedGlobally
|
||||
: cmTarget::Visibility::Imported,
|
||||
this, cmTarget::PerConfig::Yes));
|
||||
auto target =
|
||||
cm::make_unique<cmTarget>(name, type,
|
||||
global ? cmTarget::Visibility::ImportedGlobally
|
||||
: cmTarget::Visibility::Imported,
|
||||
this, cmTarget::PerConfig::Yes);
|
||||
|
||||
// Add to the set of available imported targets.
|
||||
this->ImportedTargets[name] = target.get();
|
||||
@@ -3890,9 +3890,9 @@ cmTarget* cmMakefile::AddForeignTarget(std::string const& origin,
|
||||
std::string const& name)
|
||||
{
|
||||
auto foreign_name = cmStrCat("@foreign_", origin, "::", name);
|
||||
std::unique_ptr<cmTarget> target(new cmTarget(
|
||||
auto target = cm::make_unique<cmTarget>(
|
||||
foreign_name, cmStateEnums::TargetType::INTERFACE_LIBRARY,
|
||||
cmTarget::Visibility::Foreign, this, cmTarget::PerConfig::Yes));
|
||||
cmTarget::Visibility::Foreign, this, cmTarget::PerConfig::Yes);
|
||||
|
||||
this->ImportedTargets[foreign_name] = target.get();
|
||||
this->GetGlobalGenerator()->IndexTarget(target.get());
|
||||
|
||||
Reference in New Issue
Block a user