From 47c6b131eaff82edfb9be77d4741b21a77cc7f7c Mon Sep 17 00:00:00 2001 From: Sander Schobers Date: Thu, 15 Feb 2018 21:32:30 +0100 Subject: [PATCH] Changed the #cgo conditionals to build constraints. - Build constraint for static building is called "static" now. Reference: https://golang.org/pkg/go/build/#hdr-Build_Constraints. --- allegro5/c.go | 6 +++--- allegro5/c_windows.go | 6 ++++++ allegro5/c_windows_static.go | 6 ++++++ 3 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 allegro5/c_windows.go create mode 100644 allegro5/c_windows_static.go diff --git a/allegro5/c.go b/allegro5/c.go index ec0edea..090dbe7 100644 --- a/allegro5/c.go +++ b/allegro5/c.go @@ -1,6 +1,6 @@ +// +build !windows + package allegro5 -// #cgo !windows pkg-config: allegro-5 allegro_font-5 allegro_image-5 allegro_primitives-5 allegro_ttf-5 -// #cgo windows,!allegro_static LDFLAGS: -lallegro -lallegro_font -lallegro_image -lallegro_primitives -lallegro_ttf -// #cgo windows,allegro_static LDFLAGS: -lallegro_monolith-static -ljpeg -ldumb -lFLAC -lfreetype -lvorbisfile -lvorbis -logg -lphysfs -lpng16 -lzlib -luuid -lkernel32 -lwinmm -lpsapi -lopengl32 -lglu32 -luser32 -lcomdlg32 -lgdi32 -lshell32 -lole32 -ladvapi32 -lws2_32 -lshlwapi -lstdc++ +// #cgo pkg-config: allegro-5 allegro_font-5 allegro_image-5 allegro_primitives-5 allegro_ttf-5 import "C" diff --git a/allegro5/c_windows.go b/allegro5/c_windows.go new file mode 100644 index 0000000..0ca62d4 --- /dev/null +++ b/allegro5/c_windows.go @@ -0,0 +1,6 @@ +// +build windows,!static + +package allegro5 + +// #cgo LDFLAGS: -lallegro -lallegro_font -lallegro_image -lallegro_primitives -lallegro_ttf +import "C" diff --git a/allegro5/c_windows_static.go b/allegro5/c_windows_static.go new file mode 100644 index 0000000..3bbb6da --- /dev/null +++ b/allegro5/c_windows_static.go @@ -0,0 +1,6 @@ +// +build windows,static + +package allegro5 + +// #cgo LDFLAGS: -lallegro_monolith-static -ljpeg -ldumb -lFLAC -lfreetype -lvorbisfile -lvorbis -logg -lphysfs -lpng16 -lzlib -luuid -lkernel32 -lwinmm -lpsapi -lopengl32 -lglu32 -luser32 -lcomdlg32 -lgdi32 -lshell32 -lole32 -ladvapi32 -lws2_32 -lshlwapi -lstdc++ +import "C"