From 6eeaf689c0ae81bf9df46f975b014b2b9e465f0a Mon Sep 17 00:00:00 2001 From: Clément Pit--Claudel Date: Fri, 31 Jul 2015 16:45:02 -0700 Subject: Add a Linux z3 binary to the repo, and use that or z3.exe based on the OS --- Binaries/z3 | Bin 0 -> 16438468 bytes Source/Dafny/DafnyOptions.cs | 10 ++++++++++ 2 files changed, 10 insertions(+) create mode 100644 Binaries/z3 diff --git a/Binaries/z3 b/Binaries/z3 new file mode 100644 index 00000000..7c60feb4 Binary files /dev/null and b/Binaries/z3 differ diff --git a/Source/Dafny/DafnyOptions.cs b/Source/Dafny/DafnyOptions.cs index 8972c490..66cf639f 100644 --- a/Source/Dafny/DafnyOptions.cs +++ b/Source/Dafny/DafnyOptions.cs @@ -11,6 +11,7 @@ namespace Microsoft.Dafny { public DafnyOptions() : base("Dafny", "Dafny program verifier") { + SetZ3ExecutableName(); } public override string VersionNumber { @@ -255,6 +256,15 @@ namespace Microsoft.Dafny // TODO: provide attribute help here } + private void SetZ3ExecutableName() { + var platform = (int)System.Environment.OSVersion.Platform; + var isLinux = platform == 4 || platform == 128; // http://www.mono-project.com/docs/faq/technical/ + + //TODO should we also vendor an OSX build? + var binDir = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location); + Z3ExecutablePath = System.IO.Path.Combine(binDir, isLinux ? "z3" : "z3.exe"); + } + public override void Usage() { Console.WriteLine(@" ---- Dafny options --------------------------------------------------------- -- cgit v1.2.3