diff options
author | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-03-13 15:45:37 +0100 |
---|---|---|
committer | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-04-17 14:34:48 +0200 |
commit | aecbf876cd0a7894396a2e5034af9d93bf028aa0 (patch) | |
tree | 9b5742ee8e610cd396116eb56aa3fd764a4a8b56 /src/client.cpp | |
parent | 4a730fa0b08c68fc01f35b79a43fdd72411f2b83 (diff) | |
download | mana-aecbf876cd0a7894396a2e5034af9d93bf028aa0.tar.gz mana-aecbf876cd0a7894396a2e5034af9d93bf028aa0.tar.bz2 mana-aecbf876cd0a7894396a2e5034af9d93bf028aa0.tar.xz mana-aecbf876cd0a7894396a2e5034af9d93bf028aa0.zip |
macOS: Create an app bundle
Also enable using `cpack -G DragNDrop` to create a DMG to easily drag
Mana into the Applications folder.
The DMG is also available as a CI artifact.
The minimum deployment target has been set to 10.15, as required due to
usage of std::filesystem::create_directories.
Diffstat (limited to 'src/client.cpp')
-rw-r--r-- | src/client.cpp | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/src/client.cpp b/src/client.cpp index 6e12a579..6fe64b2a 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -70,17 +70,13 @@ #include "utils/gettext.h" #include "utils/mkdir.h" +#include "utils/specialfolder.h" #include "utils/stringutils.h" -#ifdef __APPLE__ -#include <CoreFoundation/CFBundle.h> -#endif - #include <physfs.h> #include <SDL_image.h> #ifdef _WIN32 -#include "utils/specialfolder.h" #include <SDL_syswm.h> #include <winuser.h> #endif @@ -264,17 +260,7 @@ Client::Client(const Options &options): } #if defined __APPLE__ - CFBundleRef mainBundle = CFBundleGetMainBundle(); - CFURLRef resourcesURL = CFBundleCopyResourcesDirectoryURL(mainBundle); - char path[PATH_MAX]; - if (!CFURLGetFileSystemRepresentation(resourcesURL, TRUE, (UInt8 *)path, - PATH_MAX)) - { - fprintf(stderr, "Can't find Resources directory\n"); - } - CFRelease(resourcesURL); - strncat(path, "/data", PATH_MAX - 1); - mPackageDir = path; + mPackageDir = getResourcesLocation() + "/data"; #else mPackageDir = PKG_DATADIR "data"; #endif |