Browse Source

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`.
NAKAMURA Takumi 4 years ago
parent
commit
51bf4094fb

+ 5 - 0
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.

+ 1 - 1
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()) {

+ 0 - 7
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
 {

+ 0 - 1
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();