Transition to ZMusic as DLL

Here, developers communicate stuff that does not go onto the main News section or the front page of the site.
[Dev Blog] [Development Builds] [Git Change Log] [GZDoom Github Repo]

Moderator: GZDoom Developers

User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49179
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Transition to ZMusic as DLL

Post by Graf Zahl »

I just pushed a commit that completes the transition of the entire music playback code as a separate DLL.
This was done to avoid maintaining this code in separate project, both public and private.

The new project will still out of the box on Windows but you will now need to get the DLL from here, until these are available in GZDoom release packages.
For Linux and Mac users the following needs to be run before compiling GZDoom:

Code: Select all

git clone https://github.com/coelckers/ZMusic.git
cd ZMusic
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=`pwd`/../build_install ..
make install
You may have to delete your CMake cache and rebuild it for the changes to work because it may happen that the dependencies will not be fully updated.
_mental_
 
 
Posts: 3819
Joined: Sun Aug 07, 2011 4:32 am

Re: Transition to ZMusic as DLL

Post by _mental_ »

Most likely, removal of cache is needed if you want to use CMAKE_PREFIX_PATH for ZMusic header and library discovery.

Code: Select all

cmake -DCMAKE_PREFIX_PATH=/path/to/build_install ...
Setting ZMUSIC_INCLUDE_DIR and ZMUSIC_LIBRARIES directly should not require this.

Code: Select all

cmake -DZMUSIC_INCLUDE_DIR=/path/to/build_install/include -DZMUSIC_LIBRARIES=/path/to/build_install/lib/libzmusic.so ... # Linux
cmake -DZMUSIC_INCLUDE_DIR=/path/to/build_install/include -DZMUSIC_LIBRARIES=/path/to/build_install/lib/libzmusic.dylib ... # macOS
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49179
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Transition to ZMusic as DLL

Post by Graf Zahl »

The problem I had was that the cache retained the old dependencies and I couldn't make it forget about them.
User avatar
MartinHowe
Posts: 2044
Joined: Mon Aug 11, 2003 1:50 pm
Location: Waveney, United Kingdom

Re: Transition to ZMusic as DLL

Post by MartinHowe »

OK, so how does this work? I tried building gzdoom on devuan this afternoon having not seen this post, did what the post says, but I still get this:

Code: Select all

-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29") 
CMake Error at /usr/share/cmake-3.7/Modules/FindPackageHandleStandardArgs.cmake:138 (message):
  Could NOT find ZMusic (missing: ZMUSIC_LIBRARIES ZMUSIC_INCLUDE_DIR)
Call Stack (most recent call first):
  /usr/share/cmake-3.7/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
  cmake/FindZMusic.cmake:21 (find_package_handle_standard_args)
  src/CMakeLists.txt:20 (find_package)
is there some way to tell the gzdoom stuff where ZMusic is? Or is ZMusic expected to be in a specific relative path to gzdoom?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49179
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Transition to ZMusic as DLL

Post by Graf Zahl »

If all else fails you have to specify the path manually, I think _mental_ can give you better help, he wrote the script for the dependency.
_mental_
 
 
Posts: 3819
Joined: Sun Aug 07, 2011 4:32 am

Re: Transition to ZMusic as DLL

Post by _mental_ »

MartinHowe wrote:is there some way to tell the gzdoom stuff where ZMusic is?
Read my post above, it's exactly about how to do this.
User avatar
Nash
 
 
Posts: 17465
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

Re: Transition to ZMusic as DLL

Post by Nash »

Does the ZMusic DLL replace the lib*.dll files from previous distributions?
User avatar
drfrag
Vintage GZDoom Developer
Posts: 3147
Joined: Fri Apr 23, 2004 3:51 am
Location: Spain

Re: Transition to ZMusic as DLL

Post by drfrag »

Now when i try to compile with MinGW i get the following error:

Code: Select all

CMake Error at C:/DEV/cmake-3.12.4-win64-x64/share/cmake-3.12/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find ZMusic (missing: ZMUSIC_LIBRARIES ZMUSIC_INCLUDE_DIR)
Call Stack (most recent call first):
  C:/DEV/cmake-3.12.4-win64-x64/share/cmake-3.12/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
  cmake/FindZMusic.cmake:21 (find_package_handle_standard_args)
  src/CMakeLists.txt:20 (find_package)
Edit: it's compiling now.
Last edited by drfrag on Sat Feb 15, 2020 1:05 pm, edited 2 times in total.
User avatar
Rachael
Posts: 13782
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her

Re: Transition to ZMusic as DLL

Post by Rachael »

Nash wrote:Does the ZMusic DLL replace the lib*.dll files from previous distributions?
Simply adds to them, AFAIK.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49179
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Transition to ZMusic as DLL

Post by Graf Zahl »

The existing DLLs will remain, it makes little sense to incorporate all that code into zmusic as well - all this did was to offload the entire music system into a reusable subproject.
User avatar
Nash
 
 
Posts: 17465
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

Re: Transition to ZMusic as DLL

Post by Nash »

What's the difference between ZMusic.dll and ZMusicLite.dll and should I have both alongside gzdoom.exe?
User avatar
Matt
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

Re: Transition to ZMusic as DLL

Post by Matt »

Okay I have no idea what the hell I'm doing.

Is there a completely idiot-proof step by step way of getting the new dev versions to compile?
User avatar
sinisterseed
Posts: 1349
Joined: Tue Nov 05, 2019 6:48 am
Preferred Pronouns: He/Him
Graphics Processor: nVidia with Vulkan support

Re: Transition to ZMusic as DLL

Post by sinisterseed »

Nash wrote:What's the difference between ZMusic.dll and ZMusicLite.dll and should I have both alongside gzdoom.exe?
The lite version is missing the other MIDI players I think.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49179
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Transition to ZMusic as DLL

Post by Graf Zahl »

Nash wrote:What's the difference between ZMusic.dll and ZMusicLite.dll and should I have both alongside gzdoom.exe?
No, the lite version is just the GPL free subset - in case someone wants to use this in a non-GPL project, e.g. Raze uses that because it cannot use GPL code with its licensing mess.

Matt wrote:Okay I have no idea what the hell I'm doing.
Is there a completely idiot-proof step by step way of getting the new dev versions to compile?
When it comes to compiling complex projects with dependencies there is no such thing as idiot-proof-ness.
Normally it should work if you follow _mental_*s instructions.
User avatar
Matt
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

Re: Transition to ZMusic as DLL

Post by Matt »

Working now that I'm no longer trying to think of another thing I'm trying to do and can actually sit down and read and critically process instructions.

In case anyone else has a similar problem: Mental's "-DZMUSIC_INCLUDE_DIR=..." stuff is supposed to be added to the cmake command in Graf's OP not entered as a separate command.

Return to “Developer Blog”