aboutsummaryrefslogtreecommitdiffhomepage
path: root/goenv/goenv.go
diff options
context:
space:
mode:
Diffstat (limited to 'goenv/goenv.go')
-rw-r--r--goenv/goenv.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/goenv/goenv.go b/goenv/goenv.go
index 4715b8769..439d4bf1e 100644
--- a/goenv/goenv.go
+++ b/goenv/goenv.go
@@ -366,6 +366,22 @@ func findSystemClangResources(TINYGOROOT string) string {
if err == nil {
return path
}
+ case "darwin":
+ // This assumes a Homebrew installation, like in builder/commands.go.
+ var prefix string
+ switch runtime.GOARCH {
+ case "amd64":
+ prefix = "/usr/local/opt/llvm@" + llvmMajor
+ case "arm64":
+ prefix = "/opt/homebrew/opt/llvm@" + llvmMajor
+ default:
+ return "" // very unlikely for now
+ }
+ path := fmt.Sprintf("%s/lib/clang/%s", prefix, llvmMajor)
+ _, err := os.Stat(path + "/include/stdint.h")
+ if err == nil {
+ return path
+ }
}
// Could not find it.