fixed creation of *.vcproj files for object libraries
[reactos.git] / reactos / tools / rbuild / backend / msvc / vcprojmaker.cpp
index aa53c04..33fbb98 100644 (file)
@@ -53,7 +53,7 @@ MSVCBackend::_generate_vcproj ( const Module& module )
        }\r
 \r
        string module_type = GetExtension(module.GetTargetName());\r
-       bool lib = (module_type == ".lib") || (module_type == ".a");\r
+       bool lib = (module.type == ObjectLibrary) || (module_type == ".lib") || (module_type == ".a");\r
        bool dll = (module_type == ".dll") || (module_type == ".cpl");\r
        bool exe = (module_type == ".exe");\r
        // TODO FIXME - need more checks here for 'sys' and possibly 'drv'?\r
@@ -284,7 +284,7 @@ MSVCBackend::_generate_vcproj ( const Module& module )
                {\r
                        fprintf ( OUT, "\t\t\t<Tool\r\n" );\r
                        fprintf ( OUT, "\t\t\t\tName=\"VCLibrarianTool\"\r\n" );\r
-                       fprintf ( OUT, "\t\t\t\tOutputFile=\"$(OutDir)/%s.%s\"/>\r\n", module.name.c_str(), module_type.c_str() );\r
+                       fprintf ( OUT, "\t\t\t\tOutputFile=\"$(OutDir)/%s%s\"/>\r\n", module.name.c_str(), module_type.c_str() );\r
                }\r
                else\r
                {\r
@@ -300,7 +300,7 @@ MSVCBackend::_generate_vcproj ( const Module& module )
                        }\r
                        fprintf ( OUT, "\"\r\n" );\r
 \r
-                       fprintf ( OUT, "\t\t\t\tOutputFile=\"$(OutDir)/%s.%s\"\r\n", module.name.c_str(), module_type.c_str() );\r
+                       fprintf ( OUT, "\t\t\t\tOutputFile=\"$(OutDir)/%s%s\"\r\n", module.name.c_str(), module_type.c_str() );\r
                        fprintf ( OUT, "\t\t\t\tLinkIncremental=\"%d\"\r\n", debug ? 2 : 1 );\r
                        fprintf ( OUT, "\t\t\t\tGenerateDebugInformation=\"TRUE\"\r\n" );\r
 \r
@@ -448,8 +448,13 @@ MSVCBackend::_generate_sln_project (
 \r
        //FIXME: only omit ProjectDependencies in VS 2005 when there are no dependencies\r
        //NOTE: VS 2002 do not use ProjectSection; it uses GlobalSection instead\r
-       if (configuration.VSProjectVersion == "7.10") {\r
+       if ((configuration.VSProjectVersion == "7.10") || (dependencies.size() > 0)) {\r
                fprintf ( OUT, "\tProjectSection(ProjectDependencies) = postProject\r\n" );\r
+               for ( size_t i = 0; i < dependencies.size(); i++ )\r
+               {\r
+                       Dependency& dependency = *dependencies[i];\r
+                       fprintf ( OUT, "\t\t%s = %s\r\n", dependency.module.guid.c_str(), dependency.module.guid.c_str() );\r
+               }\r
                fprintf ( OUT, "\tEndProjectSection\r\n" );\r
        }\r
 \r
@@ -477,10 +482,10 @@ MSVCBackend::_generate_sln_footer ( FILE* OUT )
        fprintf ( OUT, "\tEndGlobalSection\r\n" );\r
        fprintf ( OUT, "\tGlobalSection(ExtensibilityAddIns) = postSolution\r\n" );\r
        fprintf ( OUT, "\tEndGlobalSection\r\n" );\r
-\r
        \r
        if (configuration.VSProjectVersion == "7.00") {\r
                fprintf ( OUT, "\tGlobalSection(ProjectDependencies) = postSolution\r\n" );\r
+               //FIXME: Add dependencies for VS 2002\r
                fprintf ( OUT, "\tEndGlobalSection\r\n" );\r
        }\r
 \r