summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2021-06-24 13:13:08 (GMT)
committerBrad King <brad.king@kitware.com>2021-06-29 15:07:42 (GMT)
commit51bf4094fb7c3bf82c6e51d8e6b55e0cc289e5a5 (patch)
treeff83f46ea208d8c43593891d41533d7a312f3a4c
parent7cb4ad7e3990c879088b7573d136509989ed3f5b (diff)
downloadCMake-51bf4094fb7c3bf82c6e51d8e6b55e0cc289e5a5.zip
CMake-51bf4094fb7c3bf82c6e51d8e6b55e0cc289e5a5.tar.gz
CMake-51bf4094fb7c3bf82c6e51d8e6b55e0cc289e5a5.tar.bz2
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`.
-rw-r--r--Help/release/dev/ninja-edit_cache.rst5
-rw-r--r--Source/cmGlobalCommonGenerator.cxx2
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx7
-rw-r--r--Source/cmGlobalNinjaGenerator.h1
4 files changed, 6 insertions, 9 deletions
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();