--- CMakeLists.txt 2024-11-08 00:39:37.000000000 +0800 +++ CMakeLists.txt 2024-11-08 01:01:07.000000000 +0800 @@ -13,6 +13,8 @@ option(BUNDLE_SPEEX "Bundle the speex library" OFF) option(LAZY_LOAD_LIBS "Lazily load shared libraries" ON) option(USE_SANITIZERS "Use sanitizers" ON) +option(ENABLE_JACK "Enable Jack support" OFF) +option(ENABLE_PULSE "Enable PulseAudio support" OFF) # Set debugging for runtime libraries if requested. set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") @@ -184,12 +186,14 @@ find_package(PkgConfig REQUIRED) +if(ENABLE_PULSE) pkg_check_modules(libpulse IMPORTED_TARGET libpulse) if(libpulse_FOUND) set(USE_PULSE ON) target_compile_definitions(cubeb PRIVATE DISABLE_LIBPULSE_DLOPEN) target_link_libraries(cubeb PRIVATE PkgConfig::libpulse) endif() +endif() pkg_check_modules(alsa IMPORTED_TARGET alsa) if(alsa_FOUND) @@ -198,12 +202,14 @@ target_link_libraries(cubeb PRIVATE PkgConfig::alsa) endif() +if(ENABLE_JACK) pkg_check_modules(jack IMPORTED_TARGET jack) if(jack_FOUND) set(USE_JACK ON) target_compile_definitions(cubeb PRIVATE DISABLE_LIBJACK_DLOPEN) target_link_libraries(cubeb PRIVATE PkgConfig::jack) endif() +endif() check_include_files(sndio.h USE_SNDIO) if(USE_SNDIO)