Skip to content

Commit

Permalink
Merge branch 'master' into meilers_avoid_qp_wildcard_constraint_quant…
Browse files Browse the repository at this point in the history
…ifier
  • Loading branch information
marcoeilers authored Mar 14, 2024
2 parents c2a4fa1 + 3d619b8 commit e87700a
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/main/scala/Config.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

package viper.silicon

import java.nio.file.{Path, Paths}
import java.nio.file.{Files, Path, Paths}
import scala.collection.immutable.ArraySeq
import scala.util.matching.Regex
import scala.util.Properties._
Expand Down Expand Up @@ -451,9 +451,15 @@ class Config(args: Seq[String]) extends SilFrontendConfig(args, "Silicon") {
lazy val z3Exe: String = {
val isWindows = System.getProperty("os.name").toLowerCase.startsWith("windows")

rawZ3Exe.toOption.getOrElse(
envOrNone(Z3ProverStdIO.exeEnvironmentalVariable)
.getOrElse("z3" + (if (isWindows) ".exe" else "")))
rawZ3Exe.toOption.getOrElse({
Option(System getenv Z3ProverStdIO.exeEnvironmentalVariable).getOrElse({
val filename = "z3" + (if (isWindows) ".exe" else "")
System.getenv("PATH").split(if (isWindows) ";" else ":").find(dirname => Files.exists(Paths.get(dirname, filename))) match {
case Some(dirname) => Paths.get(dirname, filename).toString
case None => filename
}
})
})
}

private val rawCvc5Exe = opt[String]("cvc5Exe",
Expand Down

0 comments on commit e87700a

Please sign in to comment.