11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
# File 'lib/leakferret/platform.rb', line 11
def triple
cpu = case RbConfig::CONFIG['host_cpu']
when /x86_64|amd64|x64/ then 'x86_64'
when /aarch64|arm64/ then 'aarch64'
else
raise Error, "unsupported CPU: #{RbConfig::CONFIG['host_cpu']}"
end
case RbConfig::CONFIG['host_os']
when /mswin|mingw|cygwin/ then "#{cpu}-pc-windows-msvc"
when /darwin/ then "#{cpu}-apple-darwin"
when /linux/
raise Error, 'aarch64-linux has no prebuilt binary yet; build from source' if cpu == 'aarch64'
"#{cpu}-unknown-linux-gnu"
else
raise Error, "unsupported OS: #{RbConfig::CONFIG['host_os']}"
end
end
|