From 51bf4094fb7c3bf82c6e51d8e6b55e0cc289e5a5 Mon Sep 17 00:00:00 2001 From: NAKAMURA Takumi Date: Thu, 24 Jun 2021 22:13:08 +0900 Subject: Ninja: Use `ccmake` for `edit_cache` If `ninja` is new enough to support the console pool, and `ccmake` is available, use it for `edit_cache`. --- Help/release/dev/ninja-edit_cache.rst | 5 +++++ Source/cmGlobalCommonGenerator.cxx | 2 +- Source/cmGlobalNinjaGenerator.cxx | 7 ------- Source/cmGlobalNinjaGenerator.h | 1 - 4 files changed, 6 insertions(+), 9 deletions(-) create mode 100644 Help/release/dev/ninja-edit_cache.rst diff --git a/Help/release/dev/ninja-edit_cache.rst b/Help/release/dev/ninja-edit_cache.rst new file mode 100644 index 0000000..9083f56 --- /dev/null +++ b/Help/release/dev/ninja-edit_cache.rst @@ -0,0 +1,5 @@ +ninja-edit_cache +---------------- + +* The :ref:`Ninja Generators` now implement the ``edit_cache`` target + using :manual:`ccmake(1)` if available. diff --git a/Source/cmGlobalCommonGenerator.cxx b/Source/cmGlobalCommonGenerator.cxx index a4112db..a8e0f23 100644 --- a/Source/cmGlobalCommonGenerator.cxx +++ b/Source/cmGlobalCommonGenerator.cxx @@ -110,7 +110,7 @@ std::string cmGlobalCommonGenerator::GetEditCacheCommand() const std::string editCacheCommand = cm->GetCMakeEditCommand(); if (!cm->GetCacheDefinition("CMAKE_EDIT_COMMAND") || !editCacheCommand.empty()) { - if (editCacheCommand.empty()) { + if (this->SupportsDirectConsole() && editCacheCommand.empty()) { editCacheCommand = cmSystemTools::GetCMakeCursesCommand(); } if (editCacheCommand.empty()) { diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index bfc50c8..2d36fd8 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -1019,13 +1019,6 @@ bool cmGlobalNinjaGenerator::HasRule(const std::string& name) // Private virtual overrides -std::string cmGlobalNinjaGenerator::GetEditCacheCommand() const -{ - // Ninja by design does not run interactive tools in the terminal, - // so our only choice is cmake-gui. - return cmSystemTools::GetCMakeGUICommand(); -} - void cmGlobalNinjaGenerator::ComputeTargetObjectDirectory( cmGeneratorTarget* gt) const { diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h index 519be3f..ec73475 100644 --- a/Source/cmGlobalNinjaGenerator.h +++ b/Source/cmGlobalNinjaGenerator.h @@ -488,7 +488,6 @@ protected: std::string DefaultFileConfig; private: - std::string GetEditCacheCommand() const override; bool FindMakeProgram(cmMakefile* mf) override; void CheckNinjaFeatures(); void CheckNinjaCodePage(); -- cgit v0.12