LibMedia: Don't link null PlaybackStream::create eagerly

This avoids static builds putting the "no-op" implementation of
PlaybackStream::create() in the static archive before the strong
implementation later. On ELF (and probably PE/COFF too), a weak
definition in a static archive is chosen and locked-in as the
definition before a strong definition later in the archive.

Before this change, static builds would have no audio support
at all.
This commit is contained in:
Andrew Kaster 2025-02-17 13:15:46 -07:00 committed by Jelle Raaijmakers
commit b7f7f58e5f
Notes: github-actions[bot] 2025-02-21 11:06:25 +00:00

View file

@ -6,7 +6,6 @@ endif()
set(SOURCES
Audio/Loader.cpp
Audio/PlaybackStream.cpp
Audio/SampleFormats.cpp
Color/ColorConverter.cpp
Color/ColorPrimaries.cpp
@ -47,4 +46,6 @@ elseif (LADYBIRD_AUDIO_BACKEND STREQUAL "OBOE")
target_link_libraries(LibMedia PRIVATE log oboe::oboe)
elseif (DEFINED LADYBIRD_AUDIO_BACKEND)
message(FATAL_ERROR "Please update ${CMAKE_CURRENT_LIST_FILE} for audio backend ${LADYBIRD_AUDIO_BACKEND}")
else ()
target_sources(LibMedia PRIVATE Audio/PlaybackStream.cpp)
endif()