Procházet zdrojové kódy

Autogen: Check added for name collisions of generated qrc_NAME.cpp files

Sebastian Holtermann před 9 roky
rodič
revize
66caae45f6
1 změnil soubory, kde provedl 14 přidání a 0 odebrání
  1. 14 0
      Source/cmQtAutoGenerators.cxx

+ 14 - 0
Source/cmQtAutoGenerators.cxx

@@ -1403,6 +1403,20 @@ bool cmQtAutoGenerators::GenerateQrcFiles()
       }
     }
 
+  // look for name collisions
+  {
+    std::multimap<std::string, std::string> collisions;
+    if( this->NameCollisionTest ( qrcGenMap, collisions ) )
+      {
+      std::cerr << "AUTOGEN: error: The same qrc_NAME.cpp file"
+                   " will be generated from different sources." << std::endl
+                << "To avoid this error rename the source .qrc files."
+                << std::endl;
+      this->NameCollisionLog ( collisions );
+      ::exit(EXIT_FAILURE);
+      }
+  }
+
   // generate qrc files
   for(std::map<std::string, std::string>::const_iterator
       si = qrcGenMap.begin(); si != qrcGenMap.end(); ++si)