diff options
author | Marc Chevrier <marc.chevrier@gmail.com> | 2019-12-29 10:36:48 (GMT) |
---|---|---|
committer | Marc Chevrier <marc.chevrier@gmail.com> | 2019-12-30 15:55:39 (GMT) |
commit | 5444a8095da50cdf4306d33fe137baa7711f1781 (patch) | |
tree | c0ec64b08aa5fda9f7b8bb88f263ba5128a205da /Source/cmExportCommand.cxx | |
parent | 15526d4b1072647179290fb5c2d0a3a5275415c7 (diff) | |
download | CMake-5444a8095da50cdf4306d33fe137baa7711f1781.zip CMake-5444a8095da50cdf4306d33fe137baa7711f1781.tar.gz CMake-5444a8095da50cdf4306d33fe137baa7711f1781.tar.bz2 |
cmGlobalGenerator: modernize memrory managemenbt
Diffstat (limited to 'Source/cmExportCommand.cxx')
-rw-r--r-- | Source/cmExportCommand.cxx | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/Source/cmExportCommand.cxx b/Source/cmExportCommand.cxx index 2a6bf5d..b7cc193 100644 --- a/Source/cmExportCommand.cxx +++ b/Source/cmExportCommand.cxx @@ -6,6 +6,8 @@ #include <sstream> #include <utility> +#include <cm/memory> + #include "cmsys/RegularExpression.hxx" #include "cm_static_string_view.hxx" @@ -182,11 +184,11 @@ bool cmExportCommand(std::vector<std::string> const& args, } // Setup export file generation. - cmExportBuildFileGenerator* ebfg = nullptr; + std::unique_ptr<cmExportBuildFileGenerator> ebfg = nullptr; if (android) { - ebfg = new cmExportBuildAndroidMKGenerator; + ebfg = cm::make_unique<cmExportBuildAndroidMKGenerator>(); } else { - ebfg = new cmExportBuildFileGenerator; + ebfg = cm::make_unique<cmExportBuildFileGenerator>(); } ebfg->SetExportFile(fname.c_str()); ebfg->SetNamespace(arguments.Namespace); @@ -196,7 +198,7 @@ bool cmExportCommand(std::vector<std::string> const& args, } else { ebfg->SetTargets(targets); } - mf.AddExportBuildFileGenerator(ebfg); + mf.AddExportBuildFileGenerator(ebfg.get()); ebfg->SetExportOld(arguments.ExportOld); // Compute the set of configurations exported. @@ -209,9 +211,9 @@ bool cmExportCommand(std::vector<std::string> const& args, ebfg->AddConfiguration(ct); } if (exportSet != nullptr) { - gg->AddBuildExportExportSet(ebfg); + gg->AddBuildExportExportSet(std::move(ebfg)); } else { - gg->AddBuildExportSet(ebfg); + gg->AddBuildExportSet(std::move(ebfg)); } return true; |