Skip to content

Commit

Permalink
nonportable build
Browse files Browse the repository at this point in the history
  • Loading branch information
burhanr13 committed Dec 30, 2024
1 parent 3cc820b commit 4152f0a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
1 change: 0 additions & 1 deletion .github/mac-bundle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ PlistBuddy Tanuki3DS.app/Contents/Info.plist -c "add CFBundleDevelopmentRegion s
PlistBuddy Tanuki3DS.app/Contents/Info.plist -c "add CFBundleInfoDictionaryVersion string 6.0"
PlistBuddy Tanuki3DS.app/Contents/Info.plist -c "add CFBundleName string Tanuki3DS"
PlistBuddy Tanuki3DS.app/Contents/Info.plist -c "add CFBundlePackageType string APPL"
PlistBuddy Tanuki3DS.app/Contents/Info.plist -c "add NSHumanReadableCopyright string Copyright 2024 Tanuki3DS Team"

# Bundle dylibs
dylibbundler -od -b -x Tanuki3DS.app/Contents/MacOS/ctremu -d Tanuki3DS.app/Contents/Frameworks -p @rpath
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ LDFLAGS := -lm -lSDL2

ifeq ($(USER), 1)
CFLAGS_RELEASE += -flto
CPPFLAGS += -DUSE_TFD
CPPFLAGS += -DUSE_TFD -DNOPORTABLE
else
LDFLAGS += -lcapstone
endif
Expand Down
10 changes: 9 additions & 1 deletion src/main.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#include "tinyfiledialogs/tinyfiledialogs.h"
#include <SDL2/SDL.h>
#include <stdio.h>
#include <unistd.h>

#include "tinyfiledialogs/tinyfiledialogs.h"

#include "3ds.h"
#include "emulator.h"
Expand Down Expand Up @@ -162,6 +164,12 @@ int main(int argc, char** argv) {
}
#endif

#ifdef NOPORTABLE
char* prefpath = SDL_GetPrefPath("", "Tanuki3DS");
chdir(prefpath);
SDL_free(prefpath);
#endif

if (emulator_init() < 0) {
SDL_Quit();
return -1;
Expand Down

0 comments on commit 4152f0a

Please sign in to comment.