- MacOS Bundle compilation included
This commit is contained in:
3
Makefile
3
Makefile
@@ -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)"
|
||||||
|
|||||||
10
mini.cpp
10
mini.cpp
@@ -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));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user