Index: NAnt.VisualCppTasks/ClTask.cs
===================================================================
RCS file: /cvsroot/nant/nant/src/NAnt.VisualCppTasks/ClTask.cs,v
retrieving revision 1.2
diff -u -r1.2 ClTask.cs
--- NAnt.VisualCppTasks/ClTask.cs	25 Feb 2003 01:04:34 -0000	1.2
+++ NAnt.VisualCppTasks/ClTask.cs	25 Feb 2003 23:23:10 -0000
@@ -100,59 +100,105 @@
         }
 
         // Task implementation
+        //
         protected override void ExecuteTask() {
             if (Sources.BaseDirectory == null) {
                 Sources.BaseDirectory = BaseDirectory;
             }
 
-            Log.WriteLine(LogPrefix + "Compiling {0} files to {1}", Sources.FileNames.Count, GetFullOutputPath());
+            Log.WriteLine(LogPrefix + "Compiling {0} files to {1}", 
+                          Sources.FileNames.Count, 
+                          GetFullOutputPath());
 
             // Create temp response file to hold compiler options
+            //
             _responseFileName = Path.GetTempFileName();
             StreamWriter writer = new StreamWriter(_responseFileName);
 
             try {
-
-                // write basic switches
-                writer.WriteLine("/c");     // compile only
+                // start with basic switches
+                //
+                string compilerArgs = null ;
 
                 // write user provided options
+                //
                 if (_options != null) {
-                    writer.WriteLine(_options);
+                    compilerArgs += _options ;
+                    compilerArgs += Environment.NewLine ;
                 }
 
                 // write user provided include directories
-                foreach (string include in Includes.FileNames) {
-                    writer.WriteLine("/I \"{0}\"", include);
+                //
+                foreach (string include in Includes.Includes) {
+
+                    compilerArgs += "/I \"" ;
+                    compilerArgs += include.Replace('/', '\\') ;
+                    compilerArgs += "\"" ;
+                    compilerArgs += Environment.NewLine ;
                 }
 
-                // specify output directories.  not that these need to end in a slash, but not a backslash.  not sure if AltDirectorySeparatorChar is the right way to get this behavior.
-                writer.WriteLine("/Fd\"{0}{1}\"", Path.Combine(BaseDirectory, OutputDir), Path.AltDirectorySeparatorChar);
-                writer.WriteLine("/Fo\"{0}{1}\"", Path.Combine(BaseDirectory, OutputDir), Path.AltDirectorySeparatorChar);
+                // specify output directories.  not that these need to end in a slash, but 
+                // not a backslash.  not sure if AltDirectorySeparatorChar is the right way 
+                // to get this behavior.
+                //
+                string  tmpoutputdir = Path.Combine(BaseDirectory, OutputDir);
+
+                tmpoutputdir = tmpoutputdir.Replace('/', '\\') ;
+                tmpoutputdir += Path.AltDirectorySeparatorChar ;
+
+                compilerArgs += "/Fd\"" ;
+                compilerArgs += tmpoutputdir ;
+                compilerArgs += "\"" ;
+                compilerArgs += Environment.NewLine ;
+                
+                compilerArgs += "/Fo\"" ;
+                compilerArgs += tmpoutputdir ;
+                compilerArgs += "\"" ;
+                compilerArgs += Environment.NewLine ;
 
                 // specify pch file, if user gave one
+                //
                 if (_pchfile != null) {
-                    writer.WriteLine("/Fp\"{0}\"", Path.Combine(Path.Combine(BaseDirectory, OutputDir), PchFile));
+
+                    compilerArgs += "/Fp\"" ;
+                    compilerArgs += Path.Combine(tmpoutputdir, PchFile) ;
+                    compilerArgs += "\"" ;
+                    compilerArgs += Environment.NewLine ;
                 }
 
+                compilerArgs += "/c" ;
+                compilerArgs += Environment.NewLine ;
+
                 // write each of the filenames
+                //
                 foreach(string filename in Sources.FileNames) {
-                    writer.WriteLine( "\"{0}\"", filename);                  
+
+                    // We don't like backslashes... only "dir" slashes.
+                    //
+                    compilerArgs += "\"" ;
+                    compilerArgs += filename.Replace('/', '\\') ;
+                    compilerArgs += "\"" ;
+                    compilerArgs += Environment.NewLine ;
                 }
 
+                writer.WriteLine( compilerArgs );
                 writer.Close();
 
                 // call base class to do the actual work
+                //
                 base.ExecuteTask();
             } finally {
                 // make sure we delete response file even if an exception is thrown
+                //
                 writer.Close(); // make sure stream is closed or file cannot be deleted
+
                 File.Delete(_responseFileName);
                 _responseFileName = null;
             }
         }
 
         // Helper functions
+        //
         protected string GetFullOutputPath() {
             return Path.GetFullPath(Path.Combine(BaseDirectory, OutputDir));
         }
