Created
April 26, 2012 12:48
-
-
Save marek-safar/2499335 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp/CSharpBindingCompilerManager.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp/CSharpBindingCompilerManager.cs | |
index 45ca0b6..164b02e 100644 | |
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp/CSharpBindingCompilerManager.cs | |
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp/CSharpBindingCompilerManager.cs | |
@@ -288,8 +288,22 @@ namespace MonoDevelop.CSharp | |
monitor.ReportError (message, e); | |
return null; | |
} | |
+ | |
+ string corlibRef = ""; | |
+ if (!compilerParameters.NoStdLib) { | |
+ if (compilerName == "mcs" && !project.TargetFramework.Id.Equals (TargetFrameworkMoniker.NET_1_1)) { | |
+ string corlib = project.AssemblyContext.GetAssemblyFullName ("mscorlib", project.TargetFramework); | |
+ if (corlib != null) { | |
+ corlib = project.AssemblyContext.GetAssemblyLocation (corlib, project.TargetFramework); | |
+ if (corlib != null && !alreadyAddedReference.Contains (corlib)) | |
+ corlibRef = " \"/r:" + corlib + "\" "; | |
+ | |
+ sb.AppendLine ("-nostdlib"); | |
+ } | |
+ } | |
+ } | |
- monitor.Log.WriteLine (compilerName + " /noconfig " + sb.ToString ().Replace ('\n',' ')); | |
+ monitor.Log.WriteLine (compilerName + " /noconfig " + corlibRef + sb.ToString ().Replace ('\n',' ')); | |
string workingDir = "."; | |
if (configuration.ParentItem != null) { | |
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Assemblies/MonoFrameworkBackend.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Assemblies/MonoFrameworkBackend.cs | |
index f20cc74..96065c9 100644 | |
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Assemblies/MonoFrameworkBackend.cs | |
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Assemblies/MonoFrameworkBackend.cs | |
@@ -104,17 +104,35 @@ namespace MonoDevelop.Core.Assemblies | |
} | |
} | |
+ | |
+ string GetMcsName (TargetFrameworkMoniker fx) | |
+ { | |
+ //old compilers for specific frameworks | |
+ if (fx.Identifier == TargetFrameworkMoniker.ID_NET_FRAMEWORK) { | |
+ switch (fx.Version) { | |
+ case "1.1": | |
+ return "mcs"; | |
+ case "2.0": | |
+ case "3.0": | |
+ case "3.5": | |
+ return "gmcs"; | |
+ case "4.0": | |
+ return "dmcs"; | |
+ } | |
+ } | |
+ | |
+ //moonlight, monotouch, mono for android | |
+ if (framework.ClrVersion == ClrVersion.Clr_2_1) | |
+ return "smcs"; | |
+ | |
+ //the new cecil-based compiler | |
+ return "mcs"; | |
+ } | |
+ | |
public override string GetToolPath (string toolName) | |
{ | |
if (toolName == "csc" || toolName == "mcs") { | |
- if (framework.ClrVersion == ClrVersion.Net_1_1) | |
- toolName = "mcs"; | |
- else if (framework.ClrVersion == ClrVersion.Net_2_0) | |
- toolName = "gmcs"; | |
- else if (framework.ClrVersion == ClrVersion.Clr_2_1) | |
- toolName = "smcs"; | |
- else if (framework.ClrVersion == ClrVersion.Net_4_0) | |
- toolName = "dmcs"; | |
+ return GetMcsName (framework.Id); | |
} | |
else if (toolName == "vbc") | |
toolName = "vbnc"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment