jarikomppa / soloud

Free, easy, portable audio engine for games
http://soloud-audio.com
Other
1.76k stars 275 forks source link

Added miniaudio backend to cmake contrib options #334

Open danman113 opened 2 years ago

danman113 commented 2 years ago

Hello, still pretty new to cmake but this is what I needed to add to the cmake files in order to get miniaudio working correctly on both OSX (clang), windows (msvc) and linux (arm/g++).

I also turned the new Miniaudio setting on by default and turned sdl2 backend off by default. My reasoning being that since miniaudio is actually included in the project, it should be the default. LMK if you think differently and I'll change it back.

danman113 commented 2 years ago

Curious what the initial contributor @valid-ptr thinks of this

valid-ptr commented 2 years ago

Curious what the initial contributor @valid-ptr thinks of this

Nice PR.

It can be a good idea to add ${BACKENDS_PATH}/miniaudio/miniaudio.h to the BACKENDS_SOURCES also. Then it will appear in the project (generated by cmake)

danman113 commented 2 years ago

It can be a good idea to add ${BACKENDS_PATH}/miniaudio/miniaudio.h to the BACKENDS_SOURCES also. Then it will appear in the project (generated by cmake)

Forgive my unfamiliarity with cmake but is this necessary? soloud_miniaudio.cpp already includes miniaudio.h? It seems to work just fine without adding to the backend sources. Is there a non-functional reason to add that?

danman113 commented 2 years ago

@jarikomppa any thoughts on this?

valid-ptr commented 2 years ago

Header should be included because cmake can generate the project for Visual Studio or Xcode as instance. The reason to include - is that the developer can access this header from IDE and at least can see that it's presented in the project.

PS If you compile some program like g++ main.cpp you should not pass headers (which main.cpp uses) of course

PPS Imaging the header-only library and how it will be presented in the IDE after cmake-generator phase ;^)

danman113 commented 2 years ago

Header should be included because cmake can generate the project for Visual Studio or Xcode as instance. The reason to include - is that the developer can access this header from IDE and at least can see that it's presented in the project.

PS If you compile some program like g++ main.cpp you should not pass headers (which main.cpp uses) of course

PPS Imaging the header-only library and how it will be presented in the IDE after cmake-generator phase ;^)

Got it, thanks for the explanation! I went ahead and added it to BACKENDS_SOURCES

danman113 commented 2 years ago

Bump?

danman113 commented 2 years ago

Monthly Bump

danman113 commented 2 years ago

Bi-annual Bump

TheSunCat commented 2 years ago

I'm running into this issue using CMake, thanks for making this PR! I guess I'll switch to your fork until it gets merged.

danman113 commented 2 years ago

I'm running into this issue using CMake, thanks for making this PR! I guess I'll switch to your fork until it gets merged.

Glad I could help!