From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Mirko Vogt Date: Mon, 20 Jul 2026 12:00:00 +0000 Subject: [PATCH] cmake: add an explicit BUILD_WITH_SOXR option Upstream looks SOXR up with an unconditional pkg_search_module(), so the optional resampling feature is enabled purely by whether libsoxr is discoverable in the build environment. In a shared package staging that is non-deterministic. Guard the lookup behind a real option (default ON, preserving previous behaviour) and mark it REQUIRED, so an enabled-but-missing libsoxr fails at configure time instead of silently dropping the feature. Signed-off-by: Mirko Vogt Assisted-By: Claude Opus 4.8 (1M context) --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -264,7 +264,10 @@ if(NOT WIN32 AND NOT ANDROID) endif() endif() - pkg_search_module(SOXR soxr) + option(BUILD_WITH_SOXR "Build with SOXR resampling support" ON) + if(BUILD_WITH_SOXR) + pkg_search_module(SOXR REQUIRED soxr) + endif() if(SOXR_FOUND) add_compile_definitions(HAS_SOXR) else()