CSFML icon indicating copy to clipboard operation
CSFML copied to clipboard

Add NuGet support for macOS

Open eXpl0it3r opened this issue 2 years ago • 2 comments

The current NuGet packages don't support macOS.

I've spent quite some time getting this working, but have been unsuccessful with the RPATH/in-package dependency resolving. This issue is a placeholder to keep track of this task.

See also #158

eXpl0it3r avatar Jul 11 '21 14:07 eXpl0it3r

This should be a good resource for figuring this out: https://gitlab.kitware.com/cmake/community/-/wikis/doc/cmake/RPATH-handling

eXpl0it3r avatar Aug 02 '21 11:08 eXpl0it3r

For some reason I totally overlooked #151 which also has some hints for building on macOS

eXpl0it3r avatar Aug 02 '21 22:08 eXpl0it3r

I finally understand the parts of the issue and thus probably the missing puzzle pieces:

  • Because we're using generic CSFML module names (e.g. csfml-graphics vs libcsfml-graphics.dylib), the search path doesn't include the .dylib suffix, despite the MS docs claiming to add those automatically.
  • The library search doesn't look inside the nuget package location and/or the dylibs aren't automatically copied to the output directory, so even of they are named correctly, they are not found.
  • The SFML dependencies (e.g. freetype as framework) aren't packaged with the nuget file and this can't be found.

Potential solutions:

  • Add an name resolution override function that correctly handles the naming per platform.
  • Look into the mechanics of how and when native library files are copied. Do they just need to match in name?
  • Consider linking SFML statically and include OpenAL32 in the nuget package

eXpl0it3r avatar May 01 '23 22:05 eXpl0it3r

Well it took a lot of tinkering and adding some not so nice workarounds with rpath resolving, but it's finally working! 🥳

Please give the newly published package a try: https://www.nuget.org/packages/CSFML/2.5.2

eXpl0it3r avatar Jun 08 '23 22:06 eXpl0it3r

Fixed with #185

eXpl0it3r avatar Jun 09 '23 19:06 eXpl0it3r