b4d1411fd9
The sc_app_core static library was always compiled with SC_HAS_SENDER=1, pulling CaptureFactory into receiver-only builds where the capture backend does not exist. Three fixes: - sc_app_core's cpp_args and capture dependency now follow the sender meson option, so pipelines.cpp and sender_session.cpp compile their sender code out on receiver-only targets. - sender_session.cpp is fully guarded by SC_HAS_SENDER; its body is sender pipeline orchestration and has no business in a receiver. - address_preference moved from a SenderSession static to a free inline function in sender_session.h — run_discover (available in every build) uses it for address sorting. Also: the root meson.build now errors early if gui=true without sender=true (the GUI is a sender panel). Verified: meson test 5/5 in both configurations; the receiver-only binary refuses --send with a clear message; the full build's sender, GUI, and tests are unchanged.
51 lines
1.4 KiB
Meson
51 lines
1.4 KiB
Meson
# Shared application internals used by both the CLI binary and the GUI:
|
|
# pipelines, session orchestration, and the state store. The sender
|
|
# pipeline is only compiled when the sender is built; receiver-only
|
|
# targets must not require the capture backend.
|
|
|
|
sc_app_core_sources = files(
|
|
'pipelines.cpp',
|
|
'sender_session.cpp',
|
|
'state_store.cpp',
|
|
)
|
|
|
|
sc_app_core_args = []
|
|
sc_app_core_deps = [dep_json]
|
|
if build_sender
|
|
sc_app_core_args += ['-DSC_HAS_SENDER=1']
|
|
sc_app_core_deps += [sc_capture_dep]
|
|
endif
|
|
|
|
sc_app_core = static_library('sc_app_core',
|
|
sc_app_core_sources,
|
|
include_directories : [sc_core_inc, include_directories('.')],
|
|
cpp_args : sc_app_core_args,
|
|
dependencies : sc_app_core_deps)
|
|
|
|
sc_app_core_dep = declare_dependency(
|
|
link_with : sc_app_core,
|
|
include_directories : include_directories('.'),
|
|
dependencies : [dep_json])
|
|
|
|
# The screencast application binary wiring every module together.
|
|
# Receiver-only builds (-Dsender=false) exclude the capture backend and the
|
|
# sender pipeline.
|
|
|
|
screencast_sources = [
|
|
'cli.cpp',
|
|
'main.cpp',
|
|
]
|
|
|
|
screencast_dependencies = [sc_app_core_dep, sc_codec_dep, sc_network_dep, sc_render_dep]
|
|
screencast_arguments = []
|
|
|
|
if build_sender
|
|
screencast_dependencies += [sc_capture_dep]
|
|
screencast_arguments += ['-DSC_HAS_SENDER=1']
|
|
endif
|
|
|
|
executable('screencast',
|
|
screencast_sources,
|
|
cpp_args : screencast_arguments,
|
|
dependencies : screencast_dependencies,
|
|
install : true) |