don't allow duplicate module names
authorRoyce Mitchell III <royce3@ev1.net>
Sat, 8 Jan 2005 05:22:02 +0000 (05:22 +0000)
committerRoyce Mitchell III <royce3@ev1.net>
Sat, 8 Jan 2005 05:22:02 +0000 (05:22 +0000)
svn path=/branches/xmlbuildsystem/; revision=12881

reactos/tools/rbuild/project.cpp

index ec5a692..c46c25f 100644 (file)
@@ -77,7 +77,14 @@ Project::ProcessXMLSubElement ( const XMLElement& e, const string& path )
        string subpath(path);\r
        if ( e.name == "module" )\r
        {\r
        string subpath(path);\r
        if ( e.name == "module" )\r
        {\r
-               modules.push_back ( new Module ( *this, e, path ) );\r
+               Module* module = new Module ( *this, e, path );\r
+               if ( LocateModule ( module->name ) )\r
+                       throw InvalidBuildFileException (\r
+                               node->location,\r
+                               "module name conflict: '%s' (originally defined at %s)",\r
+                               module->name.c_str(),\r
+                               module->node.location.c_str() );\r
+               modules.push_back ( module );\r
                return; // defer processing until later\r
        }\r
        else if ( e.name == "directory" )\r
                return; // defer processing until later\r
        }\r
        else if ( e.name == "directory" )\r