SDL_mixer icon indicating copy to clipboard operation
SDL_mixer copied to clipboard

CMake support for libxmp?

Open slouken opened this issue 2 years ago • 13 comments

The current CI fails because libxmp is missing vendored library CMake support: https://github.com/libsdl-org/SDL_mixer/runs/7365768492?check_suite_focus=true

Maybe we don't need it? It's provided for Visual Studio in VisualC/external

What's the best way to fix this?

slouken avatar Jul 15 '22 22:07 slouken

Current libmp development tree has full support for cmake, we hope to make a 4.5.1 release soon (we hope..) IMO, there are two options:

  • backport it to 4.5.0-SDL branch
  • change SDL_mixer to use the current git master (which is super stable) until libxmp-4.5.1 is released.

sezero avatar Jul 15 '22 22:07 sezero

I'm fine with either solution.

slouken avatar Jul 15 '22 22:07 slouken

I'm fine with either solution.

Then I suggest the second solution: Since the libxmp switch is in SDL_mixer development branch, a libxmp-4.5.1 release should happen long before a new SDL_mixer release.

sezero avatar Jul 15 '22 22:07 sezero

Actually we can't use master directly because we need Android.mk. Maybe we branch the current master as pre4.5.1-SDL?

slouken avatar Jul 15 '22 22:07 slouken

Actually we can't use master directly because we need Android.mk. Maybe we branch the current master as pre4.5.1-SDL?

That was what I meant :)

sezero avatar Jul 15 '22 22:07 sezero

Sure, go for it.

slouken avatar Jul 15 '22 22:07 slouken

Pushed initial work, hopefully correct and works.

sezero avatar Jul 15 '22 23:07 sezero

@madebr: If there are cmake glitches in there let us know so that we can fix in mainstream too.

sezero avatar Jul 15 '22 23:07 sezero

MSVC vendored libxmp build is failing because libxmp-vendored support isn't there: https://github.com/libsdl-org/SDL_mixer/blob/main/CMakeLists.txt#L585

Leaving things to @madebr

sezero avatar Jul 15 '22 23:07 sezero

Pushed initial work, hopefully correct and works.

@slouken: your xcode project file needs updating after the 4.5.1 switch:

  • ../../external/libxmp/src/filetype.c needs adding to sources.
  • HAVE_ROUND define no longer needed.
  • HAVE_LIBM define is not needed.
  • LIBXMP_NO_DEPACKERS and LIBXMP_NO_PROWIZARD defines are no longer needed: they are implied by LIBXMP_CORE_PLAYER .
  • "\"$(SRCROOT)/../../external/libxmp/src\"" and "\"$(SRCROOT)/../../external/libxmp/src/loaders\"" in HEADER_SEARCH_PATHS no longer needed: libxmp sources now use relative paths in include directives.

sezero avatar Jul 15 '22 23:07 sezero

@slouken: your xcode project file needs updating after the 4.5.1 switch:

In addition, since you are building a dylib, do define XMP_SYM_VISIBILITY and build with -fvisibility=hidden

sezero avatar Jul 16 '22 00:07 sezero

Done!

slouken avatar Jul 16 '22 00:07 slouken

CMake support has been added in https://github.com/libsdl-org/SDL_mixer/commit/9ad5eb2c35b72e6a69e381e94471ddbfb2ad8a6c Is something else missing?

madebr avatar Aug 03 '22 20:08 madebr

I think that this issue has been solved

fjtrujy avatar Aug 16 '22 20:08 fjtrujy