fixed creation of *.vcproj files for object libraries
authorChristoph von Wittich <christoph_vw@reactos.org>
Thu, 20 Oct 2005 21:55:55 +0000 (21:55 +0000)
committerChristoph von Wittich <christoph_vw@reactos.org>
Thu, 20 Oct 2005 21:55:55 +0000 (21:55 +0000)
started implementing code which adds dependencies to *.sln file
fixed some warnings in cmd when compiling with msvc 2005

svn path=/trunk/; revision=18646

reactos/subsys/system/cmd/precomp.h
reactos/tools/rbuild/backend/msvc/vcprojmaker.cpp

index 5aa0233..873256b 100644 (file)
@@ -1,5 +1,6 @@
 #ifdef _MSC_VER
 #pragma warning ( disable : 4103 ) /* use #pragma pack to change alignment */
+#define _CRT_SECURE_NO_DEPRECATE
 #endif//_MSC_VER
 
 #include <stdlib.h>
index 7bba279..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
@@ -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