build: compatible spaces in path outputted from pkg-config

This commit is contained in:
Li Jie
2024-11-19 15:55:31 +08:00
parent 7734c654a7
commit 9cec486a1b
5 changed files with 207 additions and 22 deletions

6
xtool/env/env.go vendored
View File

@@ -22,6 +22,8 @@ import (
"os/exec"
"regexp"
"strings"
"github.com/goplus/llgo/internal/safesplit"
)
var (
@@ -29,6 +31,10 @@ var (
reFlag = regexp.MustCompile(`[^ \t\n]+`)
)
func ExpandEnvToArgs(s string) []string {
return safesplit.SplitPkgConfigFlags(expandEnvWithCmd(s))
}
func ExpandEnv(s string) string {
return expandEnvWithCmd(s)
}