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.
This commit is contained in:
Sander Schobers 2018-02-15 21:32:30 +01:00
parent ff60dcb236
commit 47c6b131ea
3 changed files with 15 additions and 3 deletions

View File

@ -1,6 +1,6 @@
// +build !windows
package allegro5 package allegro5
// #cgo !windows pkg-config: allegro-5 allegro_font-5 allegro_image-5 allegro_primitives-5 allegro_ttf-5 // #cgo 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++
import "C" import "C"

6
allegro5/c_windows.go Normal file
View File

@ -0,0 +1,6 @@
// +build windows,!static
package allegro5
// #cgo LDFLAGS: -lallegro -lallegro_font -lallegro_image -lallegro_primitives -lallegro_ttf
import "C"

View File

@ -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"