- MacOS Bundle compilation included

This commit is contained in:
2023-01-13 17:50:29 +01:00
parent a42641653f
commit 4cf3987dc3
2 changed files with 13 additions and 0 deletions

View File

@@ -16,6 +16,9 @@ macos:
macos_debug: macos_debug:
clang++ $(source) -D DEBUG -g -Wall -Os -ffunction-sections -fdata-sections -lSDL2 -lSDL2_mixer -o "$(executable)_debug" clang++ $(source) -D DEBUG -g -Wall -Os -ffunction-sections -fdata-sections -lSDL2 -lSDL2_mixer -o "$(executable)_debug"
macos_bundle:
clang++ $(source) -D MACOS_BUNDLE -Wall -Os -framework SDL2 -framework SDL2_mixer -F /Library/Frameworks -ffunction-sections -fdata-sections -o mini_bundle -rpath @executable_path/../Frameworks/ -target x86_64-apple-macos10.12
linux: linux:
g++ $(source) -Wall -Os -ffunction-sections -fdata-sections -Wl,--gc-sections -lSDL2 -lSDL2_mixer -o "$(executable)" g++ $(source) -Wall -Os -ffunction-sections -fdata-sections -Wl,--gc-sections -lSDL2 -lSDL2_mixer -o "$(executable)"
strip -s -R .comment -R .gnu.version --strip-unneeded "$(executable)" strip -s -R .comment -R .gnu.version --strip-unneeded "$(executable)"

View File

@@ -5,6 +5,10 @@
#include "gif.c" #include "gif.c"
#include "SDL2/SDL_mixer.h" #include "SDL2/SDL_mixer.h"
#ifdef MACOS_BUNDLE
#include <libgen.h>
#endif
#pragma pack(1) #pragma pack(1)
struct surface_t { struct surface_t {
@@ -213,6 +217,12 @@ int main(int argc,char*argv[]){
bi += 5; bi += 5;
} }
#ifdef MACOS_BUNDLE
char res_file[255] = "";
strcpy(res_file, dirname(argv[0]));
strcat(res_file, "/../Resources/data.jrf");
file_setresourcefilename(res_file);
#endif
read_ini(); read_ini();
setdest(newsurf(screen_width, screen_height)); setdest(newsurf(screen_width, screen_height));