diff options
author | Michael Lowell Roberts <mirobert@microsoft.com> | 2015-06-16 15:02:55 -0700 |
---|---|---|
committer | Michael Lowell Roberts <mirobert@microsoft.com> | 2015-06-16 15:02:55 -0700 |
commit | 379f88f77fbb86a4be9eac6825c7a9c1aabb2316 (patch) | |
tree | d4097db5792746da75aa7271b6b4bc72f773d6d8 | |
parent | 838c51d897d9daec2ee7b50a40b78c96cbfbf605 (diff) |
System.Collections.Immutable.dll is now stored in the Binaries directory and copied to the output directory when the /optimize flag is used.
-rw-r--r-- | Binaries/System.Collections.Immutable.dll | bin | 0 -> 149752 bytes | |||
-rw-r--r-- | Source/DafnyDriver/DafnyDriver.cs | 18 |
2 files changed, 15 insertions, 3 deletions
diff --git a/Binaries/System.Collections.Immutable.dll b/Binaries/System.Collections.Immutable.dll Binary files differnew file mode 100644 index 00000000..bcf23fe5 --- /dev/null +++ b/Binaries/System.Collections.Immutable.dll diff --git a/Source/DafnyDriver/DafnyDriver.cs b/Source/DafnyDriver/DafnyDriver.cs index cf464754..ce4d726f 100644 --- a/Source/DafnyDriver/DafnyDriver.cs +++ b/Source/DafnyDriver/DafnyDriver.cs @@ -349,10 +349,13 @@ namespace Microsoft.Dafny cp.ReferencedAssemblies.Add("System.Core.dll");
cp.ReferencedAssemblies.Add("System.dll");
+ var libPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + Path.DirectorySeparatorChar;
+ var immutableDllFileName = "System.Collections.Immutable.dll";
+ var immutableDllPath = libPath + immutableDllFileName;
+
if (DafnyOptions.O.Optimize) {
- var libPath = Path.GetDirectoryName(dafnyProgramName);
- cp.CompilerOptions += string.Format(" /optimize /define:DAFNY_USE_SYSTEM_COLLECTIONS_IMMUTABLE /lib:{0}", libPath);
- cp.ReferencedAssemblies.Add("System.Collections.Immutable.dll");
+ cp.CompilerOptions += " /optimize /define:DAFNY_USE_SYSTEM_COLLECTIONS_IMMUTABLE";
+ cp.ReferencedAssemblies.Add(immutableDllPath);
cp.ReferencedAssemblies.Add("System.Runtime.dll");
}
@@ -375,6 +378,15 @@ namespace Microsoft.Dafny }
} else if (cr.Errors.Count == 0) {
outputWriter.WriteLine("Compiled assembly into {0}", assemblyName);
+ if (DafnyOptions.O.Optimize) {
+ var outputDir = Path.GetDirectoryName(dafnyProgramName);
+ if (string.IsNullOrWhiteSpace(outputDir)) {
+ outputDir = ".";
+ }
+ var destPath = outputDir + Path.DirectorySeparatorChar + immutableDllFileName;
+ File.Copy(immutableDllPath, destPath, true);
+ outputWriter.WriteLine("Copied /optimize dependency {0} to {1}", immutableDllFileName, outputDir);
+ }
} else {
outputWriter.WriteLine("Errors compiling program into {0}", assemblyName);
foreach (var ce in cr.Errors) {
|