cgo: add package directory to header include paths

This commit is contained in:
Ayke van Laethem
2018-11-30 13:01:20 +01:00
parent c6069476a7
commit 6cacafb8dc
8 changed files with 25 additions and 8 deletions
+3 -1
View File
@@ -32,6 +32,7 @@ func init() {
type Config struct {
Triple string // LLVM target triple, e.g. x86_64-unknown-linux-gnu (empty string means default)
GC string // garbage collection strategy
CFlags []string // flags to pass to cgo
DumpSSA bool // dump Go SSA, for compiler debugging
Debug bool // add debug symbols for gdb
RootDir string // GOROOT for TinyGo
@@ -208,7 +209,8 @@ func (c *Compiler) Compile(mainPath string) error {
MaxAlign: int64(c.targetData.PrefTypeAlignment(c.i8ptrType)),
},
},
Dir: wd,
Dir: wd,
CFlags: c.CFlags,
}
if strings.HasSuffix(mainPath, ".go") {
_, err = lprogram.ImportFile(mainPath)