compileopts: add cflag '-isystem' for resource directory search since needed for Xtensa

Signed-off-by: deadprogram <ron@hybridgroup.com>
Этот коммит содержится в:
deadprogram 2023-10-23 21:12:38 +02:00 коммит произвёл Ron Evans
родитель fd50227a3d
коммит 9fd9d9c05a

Просмотреть файл

@ -265,11 +265,17 @@ func (c *Config) CFlags(libclang bool) []string {
}
resourceDir := goenv.ClangResourceDir(libclang)
if resourceDir != "" {
// The resoure directory contains the built-in clang headers like
// The resource directory contains the built-in clang headers like
// stdbool.h, stdint.h, float.h, etc.
// It is left empty if we're using an external compiler (that already
// knows these headers).
cflags = append(cflags, "-resource-dir="+resourceDir)
cflags = append(cflags,
"-resource-dir="+resourceDir,
)
if strings.HasPrefix(c.Triple(), "xtensa") {
// workaround needed in LLVM 16, see: https://github.com/espressif/llvm-project/issues/83
cflags = append(cflags, "-isystem", filepath.Join(resourceDir, "include"))
}
}
switch c.Target.Libc {
case "darwin-libSystem":