Add noaudio tag to build binary without OpenAL
This commit is contained in:
parent
f8227a3d71
commit
074c4de175
9 changed files with 29 additions and 13 deletions
|
@ -7,7 +7,7 @@ Golang bindings for [raylib](http://www.raylib.com/), a simple and easy-to-use l
|
|||
|
||||
### Requirements
|
||||
|
||||
* [OpenAL Soft](http://kcat.strangesoft.net/openal.html)
|
||||
* [OpenAL Soft](http://kcat.strangesoft.net/openal.html) NOTE: if you don't need audio you can use `-tags noaudio` during build, OpenAL will not be linked to binary, though none of the audio functions will be available.
|
||||
|
||||
* [GLFW](http://www.glfw.org/) is included as part of the Go package, but you need to make sure you have dependencies installed, see below.
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
// +build !noaudio
|
||||
|
||||
/**********************************************************************************************
|
||||
*
|
||||
* raylib.audio - Basic funtionality to work with audio
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
// +build !noaudio
|
||||
|
||||
package raylib
|
||||
|
||||
/*
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
// +build !noaudio
|
||||
|
||||
/**********************************************************************************************
|
||||
*
|
||||
* raylib.audio - Basic funtionality to work with audio
|
||||
|
@ -167,4 +169,4 @@ void StopAudioStream(AudioStream stream); // Stop audio st
|
|||
}
|
||||
#endif
|
||||
|
||||
#endif // AUDIO_H
|
||||
#endif // AUDIO_H
|
||||
|
|
|
@ -3,7 +3,9 @@
|
|||
package raylib
|
||||
|
||||
/*
|
||||
#cgo android LDFLAGS: -llog -landroid -lEGL -lGLESv2 -lOpenSLES -lopenal -lm -landroid_native_app_glue
|
||||
#cgo android LDFLAGS: -llog -landroid -lEGL -lGLESv2 -lOpenSLES -lm -landroid_native_app_glue
|
||||
#cgo android CFLAGS: -DPLATFORM_ANDROID -DGRAPHICS_API_OPENGL_ES2
|
||||
|
||||
#cgo android,!noaudio LDFLAGS: -lopenal
|
||||
*/
|
||||
import "C"
|
||||
|
|
|
@ -18,7 +18,9 @@ package raylib
|
|||
#include "external/glfw/src/posix_tls.c"
|
||||
#include "external/glfw/src/nsgl_context.m"
|
||||
|
||||
#cgo darwin LDFLAGS: -framework OpenGL -framework OpenAL -framework Cocoa -framework IOKit -framework CoreVideo
|
||||
#cgo darwin LDFLAGS: -framework OpenGL -framework Cocoa -framework IOKit -framework CoreVideo
|
||||
#cgo darwin CFLAGS: -x objective-c -Iexternal/glfw/include -D_GLFW_COCOA -D_GLFW_USE_CHDIR -D_GLFW_USE_MENUBAR -D_GLFW_USE_RETINA -Wno-deprecated-declarations -DPLATFORM_DESKTOP -DGRAPHICS_API_OPENGL_33
|
||||
|
||||
#cgo darwin,!noaudio LDFLAGS: -framework OpenAL
|
||||
*/
|
||||
import "C"
|
||||
|
|
|
@ -20,10 +20,12 @@ package raylib
|
|||
#include "external/glfw/src/xkb_unicode.c"
|
||||
#include "external/glfw/src/egl_context.c"
|
||||
|
||||
#cgo linux,!static LDFLAGS: -lGL -lopenal -lm -pthread -ldl -lrt -lX11 -lXrandr -lXinerama -lXi -lXxf86vm -lXcursor
|
||||
#cgo linux,!static CFLAGS: -D_GLFW_X11 -Iexternal/glfw/include -DPLATFORM_DESKTOP -DGRAPHICS_API_OPENGL_33 -DSHARED_OPENAL
|
||||
#cgo linux LDFLAGS: -lGL -lm -pthread -ldl -lrt -lX11 -lXrandr -lXinerama -lXi -lXxf86vm -lXcursor
|
||||
#cgo linux CFLAGS: -D_GLFW_X11 -Iexternal/glfw/include -DPLATFORM_DESKTOP -DGRAPHICS_API_OPENGL_33
|
||||
|
||||
#cgo linux,static LDFLAGS: -lGL -lopenal -lm -pthread -ldl -lrt -lX11 -lXrandr -lXinerama -lXi -lXxf86vm -lXcursor
|
||||
#cgo linux,static CFLAGS: -D_GLFW_X11 -Iexternal/glfw/include -DPLATFORM_DESKTOP -DGRAPHICS_API_OPENGL_33 -DAL_LIBTYPE_STATIC
|
||||
#cgo linux,!noaudio LDFLAGS: -lopenal
|
||||
|
||||
#cgo linux,!static CFLAGS: -DSHARED_OPENAL
|
||||
#cgo linux,static CFLAGS: -DAL_LIBTYPE_STATIC
|
||||
*/
|
||||
import "C"
|
||||
|
|
|
@ -3,7 +3,9 @@
|
|||
package raylib
|
||||
|
||||
/*
|
||||
#cgo linux,arm LDFLAGS: -lbrcmGLESv2 -lbrcmEGL -lpthread -lrt -lm -lbcm_host -lvcos -lvchiq_arm -lopenal
|
||||
#cgo linux,arm LDFLAGS: -lbrcmGLESv2 -lbrcmEGL -lpthread -lrt -lm -lbcm_host -lvcos -lvchiq_arm
|
||||
#cgo linux,arm CFLAGS: -DPLATFORM_RPI -DGRAPHICS_API_OPENGL_ES2 -I/opt/vc/include -I/opt/vc/include/interface/vcos -I/opt/vc/include/interface/vmcs_host/linux -I/opt/vc/include/interface/vcos/pthreads
|
||||
|
||||
#cgo linux,arm,!noaudio LDFLAGS: -lopenal
|
||||
*/
|
||||
import "C"
|
||||
|
|
|
@ -19,10 +19,12 @@ package raylib
|
|||
#include "external/glfw/src/wgl_context.c"
|
||||
#include "external/glfw/src/egl_context.c"
|
||||
|
||||
#cgo windows,!static LDFLAGS: -lopengl32 -lgdi32 -lopenal -lwinmm -lole32
|
||||
#cgo windows,!static CFLAGS: -D_GLFW_WIN32 -Iexternal/glfw/include -Iexternal/glfw/deps/mingw -DPLATFORM_DESKTOP -DGRAPHICS_API_OPENGL_33 -DSHARED_OPENAL
|
||||
#cgo windows LDFLAGS: -lopengl32 -lgdi32 -lwinmm -lole32
|
||||
#cgo windows CFLAGS: -D_GLFW_WIN32 -Iexternal/glfw/include -Iexternal/glfw/deps/mingw -DPLATFORM_DESKTOP -DGRAPHICS_API_OPENGL_33
|
||||
|
||||
#cgo windows,static LDFLAGS: -lopengl32 -lgdi32 -lopenal -lwinmm -lole32
|
||||
#cgo windows,static CFLAGS: -D_GLFW_WIN32 -Iexternal/glfw/include -Iexternal/glfw/deps/mingw -DPLATFORM_DESKTOP -DGRAPHICS_API_OPENGL_33 -DAL_LIBTYPE_STATIC
|
||||
#cgo windows,!noaudio LDFLAGS: -lopenal
|
||||
|
||||
#cgo windows,!static CFLAGS: -DSHARED_OPENAL
|
||||
#cgo windows,static CFLAGS: -DAL_LIBTYPE_STATIC
|
||||
*/
|
||||
import "C"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue