- Ja compila el release en mac

This commit is contained in:
2023-10-23 18:21:48 +02:00
parent 4984d9fd21
commit 2631112a4b
3 changed files with 20 additions and 6 deletions

5
.gitignore vendored
View File

@@ -1,6 +1,9 @@
.DS_Store
.vscode/*
*.exe
arounders
arounders_debug
./*.dll
release/*
release/*
respak2
*.dSYM/*

View File

@@ -69,7 +69,7 @@ macos_release:
mkdir -p Frameworks
# Fem el paquetet
respak2 -p
./respak2 -p
# Copy folders
cp data.jf2 "$(releaseFolder)/$(appName).app/Contents/Resources"
@@ -94,12 +94,12 @@ macos_release:
rm -f tmp.dmg
# Build APPLE SILICON
clang++ $(source) -D MACOS_BUNDLE -D VERSION=\"$(version)\" -std=c++11 -Wall -Os -framework SDL2 -framework SDL2_mixer -F ./Frameworks -ffunction-sections -fdata-sections -o "$(releaseFolder)/$(appName).app/Contents/MacOS/$(executable)" -rpath @executable_path/../Frameworks/ -target arm64-apple-macos11
#clang++ $(source) -D MACOS_BUNDLE -D VERSION=\"$(version)\" -std=c++11 -Wall -Os -framework SDL2 -framework SDL2_mixer -F ./Frameworks -ffunction-sections -fdata-sections -o "$(releaseFolder)/$(appName).app/Contents/MacOS/$(executable)" -rpath @executable_path/../Frameworks/ -target arm64-apple-macos11
# Build APPLE SILICON DMG
hdiutil create tmp.dmg -ov -volname "$(appName)" -fs HFS+ -srcfolder "$(releaseFolder)"
hdiutil convert tmp.dmg -format UDZO -o "$(macosAppleSiliconRelease)"
rm -f tmp.dmg
#hdiutil create tmp.dmg -ov -volname "$(appName)" -fs HFS+ -srcfolder "$(releaseFolder)"
#hdiutil convert tmp.dmg -format UDZO -o "$(macosAppleSiliconRelease)"
#rm -f tmp.dmg
# Remove data
rm -rdf Frameworks

View File

@@ -4,6 +4,10 @@
#include <SDL2/SDL.h>
#include <map>
#ifdef MACOS_BUNDLE
#include <libgen.h>
#endif
namespace game
{
bool windowHasFocus = true;
@@ -41,6 +45,13 @@ namespace game
int main(int argc, char *argv[])
{
#ifdef MACOS_BUNDLE
char res_file[255] = "";
strcpy(res_file, dirname(argv[0]));
strcat(res_file, "/../Resources/data.jf2");
file::setResourceFilename(res_file);
#endif
game::windowHasFocus = true;
game::init();
input::init(draw::getZoom());