summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalNinjaGenerator.cxx
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2020-01-02 16:07:09 (GMT)
committerMarc Chevrier <marc.chevrier@gmail.com>2020-01-07 10:03:11 (GMT)
commita00960288bedb3cd9495222e7917c9a1092ce4c9 (patch)
tree03843ce4517050e051c1a225912841c5dabb8174 /Source/cmGlobalNinjaGenerator.cxx
parente353d8bd9bfd90396089e514d5b77f027ac27e99 (diff)
downloadCMake-a00960288bedb3cd9495222e7917c9a1092ce4c9.zip
CMake-a00960288bedb3cd9495222e7917c9a1092ce4c9.tar.gz
CMake-a00960288bedb3cd9495222e7917c9a1092ce4c9.tar.bz2
GlobalGenerator family: modernize memory management
Diffstat (limited to 'Source/cmGlobalNinjaGenerator.cxx')
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx9
1 files changed, 4 insertions, 5 deletions
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index f5f5af8..4d43566 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -2223,12 +2223,11 @@ int cmcmd_cmake_ninja_dyndep(std::vector<std::string>::const_iterator argBeg,
cmake cm(cmake::RoleInternal, cmState::Unknown);
cm.SetHomeDirectory(dir_top_src);
cm.SetHomeOutputDirectory(dir_top_bld);
- std::unique_ptr<cmGlobalNinjaGenerator> ggd(
- static_cast<cmGlobalNinjaGenerator*>(cm.CreateGlobalGenerator("Ninja")));
+ auto ggd = cm.CreateGlobalGenerator("Ninja");
if (!ggd ||
- !ggd->WriteDyndepFile(dir_top_src, dir_top_bld, dir_cur_src, dir_cur_bld,
- arg_dd, arg_ddis, module_dir, linked_target_dirs,
- arg_lang)) {
+ !cm::static_reference_cast<cmGlobalNinjaGenerator>(ggd).WriteDyndepFile(
+ dir_top_src, dir_top_bld, dir_cur_src, dir_cur_bld, arg_dd, arg_ddis,
+ module_dir, linked_target_dirs, arg_lang)) {
return 1;
}
return 0;