From d8f3e68ca948ae25e923dd944b07ea4670645232 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 2 Feb 2021 19:15:06 -0500 Subject: Ninja Multi-Config: Enable relink diagnostic message We already have a message for the "Ninja" generator, but it applies to the "Ninja Multi-Config" generator too. --- Source/cmGeneratorTarget.cxx | 3 +-- Source/cmGlobalGenerator.h | 2 ++ Source/cmGlobalNinjaGenerator.h | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 9a70b16..0171d8a 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -2003,8 +2003,7 @@ bool cmGeneratorTarget::NeedRelinkBeforeInstall( // this target must be relinked. bool have_rpath = this->HaveBuildTreeRPATH(config) || this->HaveInstallTreeRPATH(config); - bool is_ninja = - this->LocalGenerator->GetGlobalGenerator()->GetName() == "Ninja"; + bool is_ninja = this->LocalGenerator->GetGlobalGenerator()->IsNinja(); if (have_rpath && is_ninja) { std::ostringstream w; diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index 86fb228..590de26 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -438,6 +438,8 @@ public: virtual bool IsVisualStudio() const { return false; } + virtual bool IsNinja() const { return false; } + /** Return true if we know the exact location of object files. If false, store the reason in the given string. This is meaningful only after EnableLanguage has been called. */ diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h index 78fcb49..0c919ef 100644 --- a/Source/cmGlobalNinjaGenerator.h +++ b/Source/cmGlobalNinjaGenerator.h @@ -170,6 +170,8 @@ public: static std::string GetActualName() { return "Ninja"; } + bool IsNinja() const override { return true; } + /** Get encoding used by generator for ninja files */ codecvt::Encoding GetMakefileEncoding() const override; -- cgit v0.12