add . to list of include directories for all projects
[reactos.git] / reactos / tools / rbuild / backend / msvc / msvcmaker.cpp
index 81f7799..dac5942 100644 (file)
@@ -20,7 +20,7 @@ MSVCBackend::_generate_dsp ( const Module& module )
        const bool wine = false;
 
        string dsp_file = DspFileName(module);
-       printf ( "Creating MSVC project: '%s'\r\n", dsp_file.c_str() );
+       printf ( "Creating MSVC project: '%s'\n", dsp_file.c_str() );
        FILE* OUT = fopen ( dsp_file.c_str(), "wb" );
 
        vector<string> imports;
@@ -55,6 +55,7 @@ MSVCBackend::_generate_dsp ( const Module& module )
        //$output->progress("$dsp_file (file $progress_current of $progress_max)");
 
        // TODO FIXME - what's diff. betw. 'c_srcs' and 'source_files'?
+       string dsp_path = module.GetBasePath();
        vector<string> c_srcs, source_files, resource_files;
        vector<const IfableData*> ifs_list;
        ifs_list.push_back ( &module.non_if_data );
@@ -69,7 +70,8 @@ MSVCBackend::_generate_dsp ( const Module& module )
                for ( i = 0; i < files.size(); i++ )
                {
                        // TODO FIXME - do we want the full path of the file here?
-                       const string& file = files[i]->name;
+                       string file = string(".") + &files[i]->name[dsp_path.size()];
+
                        source_files.push_back ( file );
                        if ( !stricmp ( Right(file,2).c_str(), ".c" ) )
                                c_srcs.push_back ( file );
@@ -306,6 +308,7 @@ MSVCBackend::_generate_dsp ( const Module& module )
                        }
                }
 
+               fprintf ( OUT, " /I \".\"" );
                for ( i = 0; i < defines.size(); i++ )
                {
                        fprintf ( OUT, " /D \"%s\"", defines[i].c_str() );
@@ -404,6 +407,7 @@ MSVCBackend::_generate_dsp ( const Module& module )
                        }
                }
 
+               fprintf ( OUT, " /I \".\"" );
                for ( i = 0; i < defines2.size(); i++ )
                {
                        const string& define = defines2[i];
@@ -532,7 +536,7 @@ MSVCBackend::_generate_dsp ( const Module& module )
                fprintf ( OUT, "!ENDIF \r\n" );
                fprintf ( OUT, "\r\n" );
        }
-
+#if 0
        if ( module.name == "winebuild" )
        {
                fprintf ( OUT, "# Begin Special Build Tool\r\n" );
@@ -545,6 +549,7 @@ MSVCBackend::_generate_dsp ( const Module& module )
                        output_dir.c_str() );
                fprintf ( OUT, "# End Special Build Tool\r\n" );
        }
+#endif
        fprintf ( OUT, "# Begin Target\r\n" );
        fprintf ( OUT, "\r\n" );
        for ( i = 0; i < cfgs.size(); i++ )
@@ -564,7 +569,7 @@ MSVCBackend::_generate_dsp ( const Module& module )
                {
                        source_file = string(".\\") + source_file;
                }
-
+#if 0
                if ( !strcmp ( &source_file[source_file.size()-5], ".spec" ) )
                {
                        string basename = string ( source_file.c_str(), source_file.size() - 5 );
@@ -578,7 +583,7 @@ MSVCBackend::_generate_dsp ( const Module& module )
                        fprintf ( OUT, "SOURCE=%s\r\n", dbg_c_file.c_str() );
                        fprintf ( OUT, "# End Source File\r\n" );
                }
-
+#endif
                fprintf ( OUT, "# Begin Source File\r\n" );
                fprintf ( OUT, "\r\n" );
 
@@ -586,6 +591,7 @@ MSVCBackend::_generate_dsp ( const Module& module )
 
                if ( !strcmp ( &source_file[source_file.size()-5], ".spec" ) )
                {
+#if 0
                        string basename = string ( source_file.c_str(), source_file.size() - 5 );
 
                        string spec_file = source_file;
@@ -659,6 +665,7 @@ MSVCBackend::_generate_dsp ( const Module& module )
                        fprintf ( OUT, "\"%s\" : $(SOURCE) \"$(INTDIR)\" \"$(OUTDIR)\"\r\n", dbg_c_file.c_str() );
                        fprintf ( OUT, "   $(BuildCmds)\r\n" );
                        fprintf ( OUT, "# End Custom Build\r\n" );
+#endif
                }
                /*else if ( source_file =~ /([^\\]*?\.h)$/ )
                {
@@ -705,7 +712,6 @@ MSVCBackend::_generate_dsp ( const Module& module )
                fprintf ( OUT, "# End Source File\r\n" );
        }
        fprintf ( OUT, "# End Group\r\n" );
-
        fprintf ( OUT, "# Begin Group \"Header Files\"\r\n" );
        fprintf ( OUT, "\r\n" );
        fprintf ( OUT, "# PROP Default_Filter \"h;hpp;hxx;hm;inl\"\r\n" );