8bitbubsy / ft2-clone

Fasttracker 2 clone for Windows/macOS/Linux
https://16-bits.org
BSD 3-Clause "New" or "Revised" License
736 stars 48 forks source link

Make CMakeLists.txt work on mac os too #13

Closed fgaz closed 7 months ago

fgaz commented 3 years ago

In NixOS we use cmake to build this package, and I noticed that it'd only require a few CMakeLists.txt modifications to make it work on mac os too, namely:

this would make it possible to drop the ad-hoc make-*.sh scripts

8bitbubsy commented 3 years ago

I don't really know how to make makefiles, so someone else has to do this. Also it's important that CMakeLists.txt still works for Linux...

fgaz commented 3 years ago

I don't really know how to make makefiles, so someone else has to do this

I know how to make basic makefiles, but I also don't really know cmake. On the NixOS package I'm applying the mac fixes externally. @OPNA2608 are you familiar with it and willing to give a hand? Otherwise I guess I can just dive into the docs and figure out something.

Also it's important that CMakeLists.txt still works for Linux

This shouldn't be a problem if all of the above fixes are applied conditionally

OPNA2608 commented 2 years ago

Sorry, I completely missed the ping :sweat_smile:. I pushed a PR that fixes the defines & library linking on macOS without breaking the Linux build.

OPNA2608 commented 2 years ago

this would make it possible to drop the ad-hoc make-*.sh scripts

Note that I only fixed the regular build process on macOS. make-macos.sh does much more than just build though - it generates a universal x86_64/arm64 binary, constructs a macOS bundle & fixes up dependency paths with install_name_tool.

All of that can be done with CMake as well, but it would require more changes than I'm able to test properly & have past experience with. As-is, it's not able to deprecate make-macos.sh yet.

8bitbubsy commented 1 year ago

This has been fixed in the latest commit. Please let me know if it's still not correct!