mtklein | 3eeb156 | 2014-11-03 10:45:50 -0800 | [diff] [blame] | 1 | package main |
| 2 | |
| 3 | // First, build Skia this way: |
| 4 | // ./gyp_skia -Dskia_shared_lib=1 && ninja -C out/Debug |
stephana | 0b5fc97 | 2014-10-31 07:11:19 -0700 | [diff] [blame] | 5 | |
| 6 | /* |
stephana | 0b5fc97 | 2014-10-31 07:11:19 -0700 | [diff] [blame] | 7 | #cgo LDFLAGS: -lGL |
| 8 | #cgo LDFLAGS: -lGLU |
mtklein | 3eeb156 | 2014-11-03 10:45:50 -0800 | [diff] [blame] | 9 | #cgo LDFLAGS: -lX11 |
| 10 | #cgo LDFLAGS: -ldl |
| 11 | #cgo LDFLAGS: -lfontconfig |
| 12 | #cgo LDFLAGS: -lfreetype |
| 13 | #cgo LDFLAGS: -lgif |
| 14 | #cgo LDFLAGS: -lm |
| 15 | #cgo LDFLAGS: -lpng |
| 16 | #cgo LDFLAGS: -lstdc++ |
| 17 | #cgo LDFLAGS: -lz |
| 18 | |
| 19 | #cgo LDFLAGS: -L ../../out/Debug/lib |
| 20 | #cgo LDFLAGS: -Wl,-rpath=../../out/Debug/lib |
| 21 | #cgo LDFLAGS: -lskia |
| 22 | |
| 23 | #cgo CFLAGS: -I../../include/c |
stephana | 0b5fc97 | 2014-10-31 07:11:19 -0700 | [diff] [blame] | 24 | #include "sk_surface.h" |
| 25 | */ |
| 26 | import "C" |
| 27 | |
mtklein | 3eeb156 | 2014-11-03 10:45:50 -0800 | [diff] [blame] | 28 | import ( |
| 29 | "fmt" |
| 30 | ) |
| 31 | |
| 32 | func main() { |
| 33 | p := C.sk_paint_new() |
| 34 | defer C.sk_paint_delete(p) |
| 35 | fmt.Println("OK!") |
stephana | 0b5fc97 | 2014-10-31 07:11:19 -0700 | [diff] [blame] | 36 | } |
| 37 | |
| 38 | // TODO: replace this with an idiomatic interface to Skia. |