more efficient detection of C++ modules, fixed bug in C++ pch support, always clean...
[reactos.git] / reactos / tools / rbuild / module.cpp
index 2425f1d..0ffae73 100644 (file)
@@ -91,7 +91,8 @@ Module::Module ( const Project& project,
          node (moduleNode),\r
          importLibrary (NULL),\r
          bootstrap (NULL),\r
-         pch (NULL)\r
+         pch (NULL),\r
+         cplusplus (false)\r
 {\r
        if ( node.name != "module" )\r
                throw Exception ( "internal tool error: Module created with non-<module> node" );\r
@@ -185,6 +186,17 @@ Module::ProcessXMLSubElement ( const XMLElement& e,
                                        e.location,\r
                                        "attribute 'first' of <file> element can only be 'true' or 'false'" );\r
                }\r
+               if ( !cplusplus )\r
+               {\r
+                       // check for c++ file\r
+                       string ext = GetExtension ( e.value );\r
+                       if ( !stricmp ( ext.c_str(), ".cpp" ) )\r
+                               cplusplus = true;\r
+                       else if ( !stricmp ( ext.c_str(), ".cc" ) )\r
+                               cplusplus = true;\r
+                       else if ( !stricmp ( ext.c_str(), ".cxx" ) )\r
+                               cplusplus = true;\r
+               }\r
                File* pFile = new File ( FixSeparator ( path + CSEP + e.value ), first );\r
                if ( pIf )\r
                        pIf->data.files.push_back ( pFile );\r