EDGE-classic
EDGE-classic copied to clipboard
macOS build
So I've gotten another one and I'm starting to recompile this on macOS.
A few things:
- i_sdlinc.h - the current SDL2/SDL.h headers fail if using MacPorts instead of Homebrew. For MacPorts, I had to modify it like so:
#ifdef _MSC_VER
#include "SDL.h"
#elif __APPLE__
#include <SDL.h>
#else
#include <SDL2/SDL.h>
#endif
Since MacPorts points to the SDL2 headers inside the SDL2/ directory unless the -I parameter is modified.
- the dependent files (edge-defs, config files etc..) currently point either to a directory using -ewad etc.. or to a self-defined directory in the current location. For macOS bundles, this poses a problem as users cannot easily set the path via the terminal (unless they are technical users) and that the macOS bundle see's itself as 'the current root directory'.
To solve this, I suggest adding APPLE directives for SDL_GetPrefPath - this would place all these files into /Users/user/Library/Application Support/edge directory and would read/write them from here, allowing the bundle to be self-contained.
I updated our i_sdlinc.h with your suggestion; I need to fix our CI file to account for it but hopefully it's working in "the real world" now. I'll work on the path stuff as well, but I suspect that's going to get a lot of TLC for all platforms to better support international locales/paths.
Going to close this one out now; as of https://github.com/edge-classic/EDGE-classic/commit/cdea9dc88b696ef3b3f3a9ae33b64261c75c8d40 SDL_GetPrefPath is used in all cases unless the user explicitly overrides it with the -home parameter on startup.