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`.
This commit is contained in:
NAKAMURA Takumi
2021-06-24 22:13:08 +09:00
committed by Brad King
parent 7cb4ad7e39
commit 51bf4094fb
4 changed files with 6 additions and 9 deletions

View File

@@ -0,0 +1,5 @@
ninja-edit_cache
----------------
* The :ref:`Ninja Generators` now implement the ``edit_cache`` target
using :manual:`ccmake(1)` if available.

View File

@@ -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()) {

View File

@@ -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
{

View File

@@ -488,7 +488,6 @@ protected:
std::string DefaultFileConfig;
private:
std::string GetEditCacheCommand() const override;
bool FindMakeProgram(cmMakefile* mf) override;
void CheckNinjaFeatures();
void CheckNinjaCodePage();