Browse Source

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.
Brad King 5 years ago
parent
commit
d8f3e68ca9
3 changed files with 5 additions and 2 deletions
  1. 1 2
      Source/cmGeneratorTarget.cxx
  2. 2 0
      Source/cmGlobalGenerator.h
  3. 2 0
      Source/cmGlobalNinjaGenerator.h

+ 1 - 2
Source/cmGeneratorTarget.cxx

@@ -2003,8 +2003,7 @@ bool cmGeneratorTarget::NeedRelinkBeforeInstall(
   // this target must be relinked.
   // this target must be relinked.
   bool have_rpath =
   bool have_rpath =
     this->HaveBuildTreeRPATH(config) || this->HaveInstallTreeRPATH(config);
     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) {
   if (have_rpath && is_ninja) {
     std::ostringstream w;
     std::ostringstream w;

+ 2 - 0
Source/cmGlobalGenerator.h

@@ -438,6 +438,8 @@ public:
 
 
   virtual bool IsVisualStudio() const { return false; }
   virtual bool IsVisualStudio() const { return false; }
 
 
+  virtual bool IsNinja() const { return false; }
+
   /** Return true if we know the exact location of object files.
   /** Return true if we know the exact location of object files.
       If false, store the reason in the given string.
       If false, store the reason in the given string.
       This is meaningful only after EnableLanguage has been called.  */
       This is meaningful only after EnableLanguage has been called.  */

+ 2 - 0
Source/cmGlobalNinjaGenerator.h

@@ -170,6 +170,8 @@ public:
 
 
   static std::string GetActualName() { return "Ninja"; }
   static std::string GetActualName() { return "Ninja"; }
 
 
+  bool IsNinja() const override { return true; }
+
   /** Get encoding used by generator for ninja files */
   /** Get encoding used by generator for ninja files */
   codecvt::Encoding GetMakefileEncoding() const override;
   codecvt::Encoding GetMakefileEncoding() const override;