diff --git a/Meta/gn/build/libs/pulse/BUILD.gn b/Meta/gn/build/libs/pulse/BUILD.gn new file mode 100644 index 00000000000..af003640904 --- /dev/null +++ b/Meta/gn/build/libs/pulse/BUILD.gn @@ -0,0 +1,13 @@ +import("//Meta/gn/build/libs/pulse/enable.gni") + +config("pulseaudio_config") { + visibility = [ ":pulse" ] + libs = [ "pulse" ] + defines = [ "HAVE_PULSEAUDIO" ] +} + +group("pulse") { + if (enable_pulseaudio) { + public_configs = [ ":pulseaudio_config" ] + } +} diff --git a/Meta/gn/build/libs/pulse/enable.gni b/Meta/gn/build/libs/pulse/enable.gni new file mode 100644 index 00000000000..fb0aee18417 --- /dev/null +++ b/Meta/gn/build/libs/pulse/enable.gni @@ -0,0 +1,4 @@ +declare_args() { + # Select whether to build with PulseAudio support in LibAudio + enable_pulseaudio = current_os == "linux" +} diff --git a/Meta/gn/secondary/Userland/Libraries/LibAudio/BUILD.gn b/Meta/gn/secondary/Userland/Libraries/LibAudio/BUILD.gn index 7090eeff351..0feb486465a 100644 --- a/Meta/gn/secondary/Userland/Libraries/LibAudio/BUILD.gn +++ b/Meta/gn/secondary/Userland/Libraries/LibAudio/BUILD.gn @@ -1,3 +1,5 @@ +import("//Meta/gn/build/libs/pulse/enable.gni") + # TODO: AudioClient IPC files for serenity shared_library("LibAudio") { @@ -8,6 +10,7 @@ shared_library("LibAudio") { "Loader.cpp", "MP3Loader.cpp", "Metadata.cpp", + "PlaybackStream.cpp", "QOALoader.cpp", "QOATypes.cpp", "RIFFTypes.cpp", @@ -17,8 +20,15 @@ shared_library("LibAudio") { "WavLoader.cpp", "WavWriter.cpp", ] + if (enable_pulseaudio) { + sources += [ + "PlaybackStreamPulseAudio.cpp", + "PulseAudioWrappers.cpp", + ] + } deps = [ "//AK", + "//Meta/gn/build/libs/pulse", "//Userland/Libraries/LibCore", "//Userland/Libraries/LibCrypto", "//Userland/Libraries/LibIPC",