add CGO_CFLAGS support (#5453)

* add CGO_CFLAGS support

* the environment variable must be split

* use shlex to handle double quotes

* wrap error
This commit is contained in:
Hector Chu
2026-07-05 09:17:26 +01:00
committed by GitHub
parent e79edb58b2
commit 02384c9414
2 changed files with 8 additions and 0 deletions
+2
View File
@@ -151,6 +151,8 @@ func Get(name string) string {
panic("could not find cache dir: " + err.Error())
}
return filepath.Join(dir, "tinygo")
case "CGO_CFLAGS":
return os.Getenv("CGO_CFLAGS")
case "CGO_ENABLED":
// Always enable CGo. It is required by a number of targets, including
// macOS and the rp2040.