mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03:00
[Linux] Make SO wrapper usage optional.
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
Import("env")
|
||||
|
||||
if "alsa" in env and env["alsa"]:
|
||||
env.add_source_files(env.drivers_sources, "asound-so_wrap.c")
|
||||
if env["use_sowrap"]:
|
||||
env.add_source_files(env.drivers_sources, "asound-so_wrap.c")
|
||||
|
||||
env.add_source_files(env.drivers_sources, "*.cpp")
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
#ifdef PULSEAUDIO_ENABLED
|
||||
#if defined(PULSEAUDIO_ENABLED) && defined(SOWRAP_ENABLED)
|
||||
extern "C" {
|
||||
extern int initialize_pulse(int verbose);
|
||||
}
|
||||
@@ -153,6 +153,7 @@ Error AudioDriverALSA::init_output_device() {
|
||||
}
|
||||
|
||||
Error AudioDriverALSA::init() {
|
||||
#ifdef SOWRAP_ENABLED
|
||||
#ifdef DEBUG_ENABLED
|
||||
int dylibloader_verbose = 1;
|
||||
#else
|
||||
@@ -167,7 +168,7 @@ Error AudioDriverALSA::init() {
|
||||
if (initialize_asound(dylibloader_verbose)) {
|
||||
return ERR_CANT_OPEN;
|
||||
}
|
||||
|
||||
#endif
|
||||
active.clear();
|
||||
exit_thread.clear();
|
||||
|
||||
|
||||
@@ -38,7 +38,11 @@
|
||||
#include "core/templates/safe_refcount.h"
|
||||
#include "servers/audio_server.h"
|
||||
|
||||
#ifdef SOWRAP_ENABLED
|
||||
#include "asound-so_wrap.h"
|
||||
#else
|
||||
#include <alsa/asoundlib.h>
|
||||
#endif
|
||||
|
||||
class AudioDriverALSA : public AudioDriver {
|
||||
Thread thread;
|
||||
|
||||
Reference in New Issue
Block a user