3eeb156822
working The key here was to get everything into a single library. Our shared library build is the easiest way to do that. Some light skimming online makes it look like perhaps cgo requires shared libraries, so that may be at play here too. BUG=skia: Review URL: https://codereview.chromium.org/698943002
39 lines
677 B
Go
39 lines
677 B
Go
package main
|
|
|
|
// First, build Skia this way:
|
|
// ./gyp_skia -Dskia_shared_lib=1 && ninja -C out/Debug
|
|
|
|
/*
|
|
#cgo LDFLAGS: -lGL
|
|
#cgo LDFLAGS: -lGLU
|
|
#cgo LDFLAGS: -lX11
|
|
#cgo LDFLAGS: -ldl
|
|
#cgo LDFLAGS: -lfontconfig
|
|
#cgo LDFLAGS: -lfreetype
|
|
#cgo LDFLAGS: -lgif
|
|
#cgo LDFLAGS: -lm
|
|
#cgo LDFLAGS: -lpng
|
|
#cgo LDFLAGS: -lstdc++
|
|
#cgo LDFLAGS: -lz
|
|
|
|
#cgo LDFLAGS: -L ../../out/Debug/lib
|
|
#cgo LDFLAGS: -Wl,-rpath=../../out/Debug/lib
|
|
#cgo LDFLAGS: -lskia
|
|
|
|
#cgo CFLAGS: -I../../include/c
|
|
#include "sk_surface.h"
|
|
*/
|
|
import "C"
|
|
|
|
import (
|
|
"fmt"
|
|
)
|
|
|
|
func main() {
|
|
p := C.sk_paint_new()
|
|
defer C.sk_paint_delete(p)
|
|
fmt.Println("OK!")
|
|
}
|
|
|
|
// TODO: replace this with an idiomatic interface to Skia.
|