aboutsummaryrefslogtreecommitdiffhomepage
path: root/loader
diff options
context:
space:
mode:
authorAyke van Laethem <[email protected]>2022-02-03 10:55:35 +0100
committerRon Evans <[email protected]>2022-02-12 15:33:06 +0100
commit850a5fdbfb00f1bdfe930bd41013d0404f75e248 (patch)
tree83bccc93292ce60d6245f2c39f5c2e25ef9f8868 /loader
parent4b2edc9a26a84b4870d61ddf09f70369ab9f6f1e (diff)
downloadtinygo-850a5fdbfb00f1bdfe930bd41013d0404f75e248.tar.gz
tinygo-850a5fdbfb00f1bdfe930bd41013d0404f75e248.zip
loader: only add Clang header path for CGo
It should only be added at the point that it is needed, for example when using libclang or using the built-in Clang. It isn't needed when running an external tool.
Diffstat (limited to 'loader')
-rw-r--r--loader/loader.go5
1 files changed, 1 insertions, 4 deletions
diff --git a/loader/loader.go b/loader/loader.go
index b8db25875..e9de2ec20 100644
--- a/loader/loader.go
+++ b/loader/loader.go
@@ -418,10 +418,7 @@ func (p *Package) parseFiles() ([]*ast.File, error) {
var initialCFlags []string
initialCFlags = append(initialCFlags, p.program.config.CFlags()...)
initialCFlags = append(initialCFlags, "-I"+p.Dir)
- if p.program.clangHeaders != "" {
- initialCFlags = append(initialCFlags, "-isystem", p.program.clangHeaders)
- }
- generated, headerCode, cflags, ldflags, accessedFiles, errs := cgo.Process(files, p.program.workingDir, p.program.fset, initialCFlags)
+ generated, headerCode, cflags, ldflags, accessedFiles, errs := cgo.Process(files, p.program.workingDir, p.program.fset, initialCFlags, p.program.clangHeaders)
p.CFlags = append(initialCFlags, cflags...)
p.CGoHeaders = headerCode
for path, hash := range accessedFiles {