From: Daniel Bevenius Date: Thu, 20 Mar 2025 17:36:02 +0000 (+0100) Subject: examples : add WHISPER_SDL2 check to deprecation executables (#2911) X-Git-Tag: upstream/1.7.5~127 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=80dad86b2c946d36121a7ebe1dfb93c50578c7b9;p=pkg%2Fggml%2Fsources%2Fwhisper.cpp examples : add WHISPER_SDL2 check to deprecation executables (#2911) This commit adds a check for `WHISPER_SDL2` to the deprecation warning examples. This is to prevent the examples from being built when WHISPER_SDL2 is not enabled. The motivation for this is that currently these deprecation executables are generate and when run they refer the user to examples with other names, for example `whisper-command` but unless they have built with `WHISPER_SDL2` those executable will not be present: ```console $ ls build/bin/ bench command main quantize stream whisper-bench whisper-cli whisper-server $ ./build/bin/command WARNING: The binary 'command' is deprecated. Please use 'whisper-command' instead. See https://github.com/ggerganov/whisper.cpp/tree/master/examples/deprecation-warning/README.md for more information. ``` --- diff --git a/examples/deprecation-warning/CMakeLists.txt b/examples/deprecation-warning/CMakeLists.txt index f845e6cc..55cef032 100644 --- a/examples/deprecation-warning/CMakeLists.txt +++ b/examples/deprecation-warning/CMakeLists.txt @@ -1,4 +1,6 @@ add_executable(main ./deprecation-warning.cpp) add_executable(bench ./deprecation-warning.cpp) -add_executable(stream ./deprecation-warning.cpp) -add_executable(command ./deprecation-warning.cpp) +if (WHISPER_SDL2) + add_executable(stream ./deprecation-warning.cpp) + add_executable(command ./deprecation-warning.cpp) +endif()