Module: Udb::Z3Loader

Extended by:
T::Sig
Defined in:
lib/udb/z3_loader.rb

Overview

Manages automatic download and installation of the Z3 library

Defined Under Namespace

Classes: Z3LoadError

Class Method Summary collapse

Class Method Details

.ensure_z3_loadedObject



60
61
62
# File 'lib/udb/z3_loader.rb', line 60

def ensure_z3_loaded
  require "z3"
end

.z3_lib_dirObject



65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/udb/z3_loader.rb', line 65

def z3_lib_dir
  cpu =
    case RbConfig::CONFIG["host_cpu"]
    when /arm64|aarch64/
      "arm64"
    when /x86_64|x64/
      "x64"
    else
      raise Z3LoadError, "Unsupported host cpu: #{RbConfig::CONFIG["host_cpu"]}"
    end
  xdg_cache = ENV.fetch("XDG_CACHE_HOME", File.join(Dir.home, ".cache"))
  File.join(xdg_cache, "udb", "z3", Udb::Z3_VERSION, cpu)
end