cgo: make -I and -L paths absolute

This is very useful for (conditionally) adding extra include paths
relative to the package path.
This commit is contained in:
Ayke van Laethem
2020-03-06 12:40:21 +01:00
committed by Ron Evans
parent 9cef23c318
commit a8da601672
4 changed files with 45 additions and 0 deletions
+4
View File
@@ -9,6 +9,9 @@ package main
#cgo CFLAGS: -DFOO
#cgo CFLAGS: -Iinclude
#include "foo.h"
#if defined(FOO)
#define BAR 3
#else
@@ -23,4 +26,5 @@ import "C"
var (
_ = C.BAR
_ = C.FOO_H
)
+1
View File
@@ -9,6 +9,7 @@ import "unsafe"
var _ unsafe.Pointer
const C.BAR = 3
const C.FOO_H = 1
type C.int16_t = int16
type C.int32_t = int32
+1
View File
@@ -0,0 +1 @@
#define FOO_H 1