summaryrefslogtreecommitdiff
path: root/vendor/github.com/ncruces/go-sqlite3/internal/util/compiler.go
blob: aeefcced97d40f9f7aeb6031667505457764cfe0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package util

import (
	"runtime"

	"golang.org/x/sys/cpu"
)

func CompilerSupported() bool {
	switch runtime.GOOS {
	case "linux", "android",
		"windows", "darwin",
		"freebsd", "netbsd", "dragonfly",
		"solaris", "illumos":
		break
	default:
		return false
	}
	switch runtime.GOARCH {
	case "amd64":
		return cpu.X86.HasSSE41
	case "arm64":
		return true
	default:
		return false
	}
}