+ if (!nomain || custom_main != null) {
+ compilerArgs.Add(temp_c);
+ compilerArgs.Add(temp_o);
+ if (custom_main != null)
+ compilerArgs.Add(quote(custom_main));
+ compilerArgs.Add(monoLib);
+ compilerArgs.Add("/link");
+ compilerArgs.Add("/NODEFAULTLIB");
+ compilerArgs.Add("/SUBSYSTEM:CONSOLE");
+ compilerArgs.AddRange(linkLibraries);
+ compilerArgs.Add("/out:"+ output);
+
+ string cl_cmd = String.Format("{0} {1}", compiler, String.Join(" ", compilerArgs.ToArray()));
+ Execute (cl_cmd);
+ }
+ else
+ {
+ // we are just creating a .lib
+ compilerArgs.Add("/c"); // compile only
+ compilerArgs.Add(temp_c);
+ compilerArgs.Add(String.Format("/Fo" + glue_obj)); // .obj output name
+
+ string cl_cmd = String.Format("{0} {1}", compiler, String.Join(" ", compilerArgs.ToArray()));
+ Execute (cl_cmd);
+
+ string librarian = GetEnv ("LIB", "lib.exe");
+ var librarianArgs = new List<string> ();
+ librarianArgs.Add (String.Format ("/out:{0}.lib" + output));
+ librarianArgs.Add (temp_o);
+ librarianArgs.Add (glue_obj);
+ librarianArgs.Add (monoLib);
+ string lib_cmd = String.Format("{0} {1}", librarian, String.Join(" ", librarianArgs.ToArray()));
+ Execute (lib_cmd);
+ }