clang-tidy: fix modernize-make-unique lint
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx index aeb68a3..9d8311d 100644 --- a/Source/cmExportFileGenerator.cxx +++ b/Source/cmExportFileGenerator.cxx
@@ -63,8 +63,8 @@ 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); }
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index d755360..11b5446 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx
@@ -3870,11 +3870,11 @@ 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 @@ 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());