In general some features can be disabled, see CMakeOptions.txt for a list, but Qt Multimedia Lib cannot be disabled easily.
If you *both* change that line to
#cmakedefine QT_MULTIMEDIA_LIB 1
*and*
and then rerun cmake (possibly after removing config.h and build.ninja or your Makefile from the build directory),
then you can build without QT_MULTIMEDIA_LIB being set. On the current master, when doing so, I get the following build error:
In file included from ui/qt/qtui_autogen/EWIEGA46WW/../../../../../wireshark/ui/qt/rtp_stream_dialog.h:16,
from ui/qt/qtui_autogen/EWIEGA46WW/../../../../../wireshark/ui/qt/main_window.h:78,
from ui/qt/qtui_autogen/EWIEGA46WW/moc_main_window.cpp:10,
from ui/qt/qtui_autogen/mocs_compilation.cpp:65:
ui/qt/qtui_autogen/EWIEGA46WW/../../../../../wireshark/ui/qt/rtp_player_dialog.h:27:10: fatal error: QAudioDeviceInfo: No such file or directory
27 | #include <QAudioDeviceInfo>
| ^~~~~~~~~~~~~~~~~~
Because QAudioDeviceInfo is part of Qt Multimedia but not properly protected by that #ifdef, which is exactly what you're trying to test.
John Thacker