From 29c239a8105d80b897ece5be491cefcfef743db8 Mon Sep 17 00:00:00 2001 From: mappu Date: Fri, 3 Mar 2017 18:16:40 +1300 Subject: [PATCH] split up cgo CFLAGS into files with separate build tags --- cflags_linux.go | 9 +++++++++ cflags_windows.go | 9 +++++++++ imagequant.go | 2 -- 3 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 cflags_linux.go create mode 100644 cflags_windows.go diff --git a/cflags_linux.go b/cflags_linux.go new file mode 100644 index 0000000..409251a --- /dev/null +++ b/cflags_linux.go @@ -0,0 +1,9 @@ +//+build !windows + +package imagequant + +/* +#cgo CFLAGS: -O3 -fno-math-errno -fopenmp -funroll-loops -fomit-frame-pointer -Wall -Wno-attributes -std=c99 -DNDEBUG -DUSE_SSE=1 -msse -fexcess-precision=fast +#cgo LDFLAGS: -lm -fopenmp +*/ +import "C" diff --git a/cflags_windows.go b/cflags_windows.go new file mode 100644 index 0000000..0800274 --- /dev/null +++ b/cflags_windows.go @@ -0,0 +1,9 @@ +//+build windows + +package imagequant + +/* +#cgo CFLAGS: -O3 -fno-math-errno -fopenmp -funroll-loops -fomit-frame-pointer -Wall -Wno-attributes -std=c99 -DNDEBUG -DUSE_SSE=1 -msse -fexcess-precision=fast +#cgo LDFLAGS: -fopenmp -static +*/ +import "C" \ No newline at end of file diff --git a/imagequant.go b/imagequant.go index 9f3d2a9..d121883 100644 --- a/imagequant.go +++ b/imagequant.go @@ -21,8 +21,6 @@ import ( ) /* -#cgo CFLAGS: -O3 -fno-math-errno -fopenmp -funroll-loops -fomit-frame-pointer -Wall -Wno-attributes -std=c99 -DNDEBUG -DUSE_SSE=1 -msse -fexcess-precision=fast -#cgo LDFLAGS: -fopenmp -static #include "libimagequant.h" const char* liqVersionString() {