xiph / opusfile

Stand-alone decoder library for .opus streams
BSD 3-Clause "New" or "Revised" License
148 stars 81 forks source link

cmake issues #33

Open sezero opened 2 years ago

sezero commented 2 years ago

In SDL_mixer, we submodule'd opus and opusfile through our forks and attempted cmake build relying on the submodules. Issues we had:

sezero commented 2 years ago

Any comments please?

sezero commented 2 years ago

PING - anyone?

xnorpx commented 1 year ago

@sezero Hi, I am not so good with all the version stuff. But can you check if this change would fix the issues you have for opus?

https://github.com/xnorpx/opus/commit/093b8dab25d5dc0ac25d7e4a47d03c6353e6cf79

sezero commented 1 year ago

@madebr: cmake is your language, can you have a look? Reference issue: https://github.com/libsdl-org/SDL_mixer/pull/386#issuecomment-1133771043 Related commits: https://github.com/libsdl-org/opusfile/commit/264fc0df35a12569554d2a716d674d59ff3c86f1 https://github.com/libsdl-org/opusfile/commit/9ba5cc3dc920fb98f1b4068888d3c4e8617ef9b6

daddesio commented 1 year ago

I like @sezero's idea of using "if" instead of "else if". That way if decoding the package_version fails, it tries again from git. Like this:

if(NOT OPUS_PACKAGE_VERSION){ try getting it from package_version file }
if(NOT OPUS_PACKAGE_VERSION){ try getting it from git }
if(NOT OPUS_PACKAGE_VERSION){ print warning and set to 0.0 }

Side note, I think it would be useful to keep a basic "version" file maintained in-repo so we don't need to fallback to 0.0. (e.g. ogg keeps the version in the configure.ac file in the repo, but opus/opusfile currently do not.) In that case, we'd still need to get the commit id from git if available (and only if the git tag matches the version file). @mark4o thoughts?