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" +
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
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":
- case "/platform":
return true;
case "/help2":
RootContext.AddConditional ("__V2__");
#endif
return true;
-#if GMCS_SOURCE
case "iso-2":
RootContext.Version = LanguageVersion.ISO_2;
return true;
case "future":
RootContext.Version = LanguageVersion.Future;
return true;
-#endif
}
+
Report.Error (1617, "Invalid -langversion option `{0}'. It must be `ISO-1', `ISO-2', `3' or `Default'", value);
return true;
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 });
}
class EmbededResource : IResource
{
-#if GMCS_SOURCE
- string name;
- string file;
- ResourceAttributes attributes;
-
- public EmbededResource (string name, string file, bool isPrivate)
- {
- this.name = name;
- this.file = file;
- this.attributes = isPrivate ? ResourceAttributes.Private : ResourceAttributes.Public;
- }
-
- public void Emit ()
- {
- RootContext.ToplevelTypes.Builder.DefineManifestResource (
- name, new FileStream (file, FileMode.Open, FileAccess.Read), attributes);
- }
-
- public string FileName {
- get { return file; }
- }
-#else
static MethodInfo embed_res;
static EmbededResource () {
return (string)args [1];
}
}
-#endif
}
class LinkedResource : IResource