public enum Target {
Library, Exe, Module, WinExe
};
+
+#if GMCS_SOURCE
+ enum Platform {
+ AnyCPU, X86, X64, IA64
+ };
+#endif
/// <summary>
/// The compiler driver.
#if !SMCS_SOURCE
" -pkg:P1[,Pn] References packages P1..Pn\n" +
#endif
+ " -platform:ARCH Specifies the target platform of the output assembly\n" +
+ " ARCH can be one of: anycpu, x86, x64 or itanium\n" +
" -recurse:SPEC Recursively compiles files according to SPEC pattern\n" +
" -reference:A1[,An] Imports metadata from the specified assembly (short: -r)\n" +
" -reference:ALIAS=A Imports metadata using specified extern alias (short: -r)\n" +
public static int Main (string[] args)
{
- RootContext.Version = LanguageVersion.Default;
-
Location.InEmacs = Environment.GetEnvironmentVariable ("EMACS") == "t";
Driver d = Driver.Create (args, true);
if (Report.Warnings > 0) {
Console.WriteLine ("Compilation succeeded - {0} warning(s)", Report.Warnings);
}
+ Environment.Exit (0);
return 0;
}
Console.WriteLine("Compilation failed: {0} error(s), {1} warnings",
Report.Errors, Report.Warnings);
+ Environment.Exit (1);
return 1;
}
if (RootContext.Version > LanguageVersion.ISO_2)
soft_references.Add ("System.Core");
+ if (RootContext.Version > LanguageVersion.V_3)
+ soft_references.Add ("Microsoft.CSharp");
}
public static string OutputFile
return true;
case "/debug":
+ if (value == "full" || value == "")
+ want_debugging_support = true;
+
+ return true;
+
case "/debug+":
want_debugging_support = true;
return true;
load_default_config = false;
return true;
+ case "/platform":
+#if GMCS_SOURCE
+ switch (value.ToLower (CultureInfo.InvariantCulture)) {
+ case "anycpu":
+ RootContext.Platform = Platform.AnyCPU;
+ break;
+ case "x86":
+ RootContext.Platform = Platform.X86;
+ break;
+ case "x64":
+ RootContext.Platform = Platform.X64;
+ break;
+ case "itanium":
+ RootContext.Platform = Platform.IA64;
+ break;
+ default:
+ Report.Error (1672, "Invalid platform type for -platform. Valid options are `anycpu', `x86', `x64' or `itanium'");
+ break;
+ }
+#endif
+ return true;
+
+ // We just ignore this.
+ case "/errorreport":
+ case "/filealign":
+ return true;
+
case "/help2":
OtherFlags ();
Environment.Exit(0);
RootContext.AddConditional ("__V2__");
#endif
return true;
-#if GMCS_SOURCE
case "iso-2":
RootContext.Version = LanguageVersion.ISO_2;
return true;
+ case "3":
+ RootContext.Version = LanguageVersion.V_3;
+ return true;
case "future":
RootContext.Version = LanguageVersion.Future;
return true;
-#endif
}
- Report.Error (1617, "Invalid option `{0}' for /langversion. It must be either `ISO-1', `ISO-2' or `Default'", value);
+
+ Report.Error (1617, "Invalid -langversion option `{0}'. It must be `ISO-1', `ISO-2', `3' or `Default'", value);
return true;
case "/codepage":
try {
CodeGen.Assembly.Builder.DefineUnmanagedResource (win32ResourceFile);
} catch (ArgumentException) {
- Report.RuntimeMissingSupport (Location.Null, "resource embeding");
+ Report.RuntimeMissingSupport (Location.Null, "resource embedding ");
}
} else {
CodeGen.Assembly.Builder.DefineVersionInfoResource ();
if (win32IconFile != null) {
MethodInfo define_icon = typeof (AssemblyBuilder).GetMethod ("DefineIconResource", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
if (define_icon == null) {
- Report.RuntimeMissingSupport (Location.Null, "resource embeding");
+ Report.RuntimeMissingSupport (Location.Null, "resource embedding");
} else {
define_icon.Invoke (CodeGen.Assembly.Builder, new object [] { win32IconFile });
}