Compiling GZDoom without zound and music?

Need help running various source ports? Did your computer break? Ask here.

Moderators: GZDoom Developers, LZDoom Developers, UZDoom Developers

Forum rules
Please be as descriptive as possible in your posts (list your hardware and operating system, the version of the source port you are using, any mods you are running and how they're being loaded, etc.)
This will help others to give you a solution!
HyperCrab2000
Posts: 2
Joined: Thu Feb 20, 2025 4:10 am
Operating System Version (Optional): macOS
Graphics Processor: Apple M1

Compiling GZDoom without zound and music?

Post by HyperCrab2000 »

What's the best way to compile GZDoom without music and sound? My project is to compile it for WASM and it's going to be a pain to get sound/music working so I was going to forgo it for now but doing this

root@ad9ab432e5b0:/gzdoom/build# cmake \
-DCMAKE_BUILD_TYPE=Release \
-DNO_FMOD=ON \
-DNO_OPENAL=ON \
-DNO_ZMUSIC=ON \
-DHAVE_ZMUSIC=OFF \
-DDYN_ZMUSIC=OFF \
-DNO_VPX=ON \
-DDYN_VPX=OFF \
..

Gives me this:


-- Could NOT find BZip2 (missing: BZIP2_LIBRARIES BZIP2_INCLUDE_DIR)
-- Could NOT find VPX (missing: VPX_LIBRARIES VPX_INCLUDE_DIR)
-- Using internal bzip2 library
-- Architecture is arm64
-- Checking for module 'gtk+-3.0'
-- No package 'gtk+-3.0' found
-- Checking for module 'gtk+-2.0'
-- No package 'gtk+-2.0' found
CMake Error at /usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find ZMusic (missing: ZMUSIC_LIBRARIES ZMUSIC_INCLUDE_DIR)
Call Stack (most recent call first):
/usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
cmake/FindZMusic.cmake:27 (find_package_handle_standard_args)
src/CMakeLists.txt:335 (find_package)


-- Configuring incomplete, errors occurred!
See also "/gzdoom/build/CMakeFiles/CMakeOutput.log".
See also "/gzdoom/build/CMakeFiles/CMakeError.log".

So I'm not really sure what to do to fully disable sound and music using cmake?

I'm making this in a fully Linux dockerized container
HyperCrab2000
Posts: 2
Joined: Thu Feb 20, 2025 4:10 am
Operating System Version (Optional): macOS
Graphics Processor: Apple M1

Re: Compiling GZDoom without zound and music?

Post by HyperCrab2000 »

Oops I forgot to log in when I made this post so I can't edit it. But I have an update now.

I tried doing this

cmake \
-DCMAKE_BUILD_TYPE=Release \
-DNO_FMOD=ON \
-DNO_OPENAL=ON \
-DNO_ZMUSIC=ON \
-DDYN_ZMUSIC=OFF \
-DZMUSIC_INCLUDE_DIR=/gzdoom/dummy_includes \
-DZMUSIC_LIBRARIES=/dev/null \
-DNO_VPX=ON \
-DDYN_VPX=OFF \
-DVPX_INCLUDE_DIR=/gzdoom/dummy_includes \
-DVPX_LIBRARIES=/dev/null \
..

And created a dummy include file
// Dummy zmusic.h
#ifndef ZMUSIC_DUMMY_H
#define ZMUSIC_DUMMY_H

// Dummy definition of ZMusic_MusicStream
typedef void* ZMusic_MusicStream;

// Dummy function stubs
inline void ZMusic_Close(ZMusic_MusicStream) {}
inline void ZMusic_Play(ZMusic_MusicStream, bool, float) {}
inline void ZMusic_Pause(ZMusic_MusicStream) {}
inline void ZMusic_Resume(ZMusic_MusicStream) {}
inline void ZMusic_Stop(ZMusic_MusicStream) {}
inline bool ZMusic_IsPlaying(ZMusic_MusicStream) { return false; }

// Missing MIDI device constants (add these)
#define MDEV_TIMIDITY 0
#define MDEV_SNDSYS 0
#define MDEV_STANDARD 0
#define MDEV_OPL 0
#define MDEV_DEFAULT 0
#define MDEV_FLUIDSYNTH 0
#define MDEV_GUS 0
#define MDEV_WILDMIDI 0
#define MDEV_ADL 0
#define MDEV_OPN 0

// Dummy MIDI device struct (used internally by GZDoom)
struct MidiDeviceSetting
{
int device;
// Add dummy members if needed
};

#endif // ZMUSIC_DUMMY_H

Because no matter what flags I used it was still trying to include zmusic.h

Now I'm trying this

cd /gzdoom/build
rm -rf *
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DNO_FMOD=ON \
-DNO_OPENAL=ON \
-DNO_ZMUSIC=ON \
-DDYN_ZMUSIC=OFF \
-DZMUSIC_INCLUDE_DIR=/gzdoom/dummy_includes \
-DZMUSIC_LIBRARIES=/dev/null \
-DNO_VPX=ON \
-DDYN_VPX=OFF \
-DVPX_INCLUDE_DIR=/gzdoom/dummy_includes \
-DVPX_LIBRARIES=/dev/null \
..

make clean
make -j4

And I'm stuck on this error so far

/gzdoom/src/common/audio/music/s_music.h:68:8: error: redefinition of 'struct MidiDeviceSetting'
68 | struct MidiDeviceSetting
| ^~~~~~~~~~~~~~~~~
In file included from /gzdoom/src/common/audio/sound/i_sound.h:42,
from /gzdoom/src/common/audio/sound/s_soundinternal.h:3,
from /gzdoom/src/sound/s_sound.h:38,
from /gzdoom/src/console/c_cmds.cpp:48:
/gzdoom/dummy_includes/zmusic.h:29:8: note: previous definition of 'struct MidiDeviceSetting'
29 | struct MidiDeviceSetting
| ^~~~~~~~~~~~~~~~~
/gzdoom/src/console/c_cmds.cpp: In function 'void Cmd_mapinfo(FCommandLine&, int)':
/gzdoom/src/console/c_cmds.cpp:1325:9: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
1325 | if (myLevel->Music.IsNotEmpty())
| ^~
/gzdoom/src/console/c_cmds.cpp:1328:17: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
1328 | Printf(" PixelStretch: %f\n", myLevel->pixelstretch);
| ^~~~~~
/gzdoom/src/console/c_cmds.cpp:1339:9: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
1339 | if (myLevel->RedirectCVARMapName.IsNotEmpty())
| ^~
/gzdoom/src/console/c_cmds.cpp:1342:17: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
1342 | Printf(" LightMode: %i\n", (int8_t)myLevel->lightmode);
| ^~~~~~
make[2]: *** [src/CMakeFiles/zdoom.dir/build.make:1264: src/CMakeFiles/zdoom.dir/console/c_cmds.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:830: src/CMakeFiles/zdoom.dir/all] Error 2
make: *** [Makefile:136: all] Error 2


So it seems like I'm rolling the ball uphill right now.

Has anyone had any luck building and compiling GZDoom without music and sound with just the flags alone?

Return to “Technical Issues”