Skip to content

Commit

Permalink
fix bug when generating mac package and -no-zip-dir given + copy dylibs
Browse files Browse the repository at this point in the history
  • Loading branch information
ianmaclarty committed Jan 11, 2019
1 parent a319609 commit d1fbc99
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/am_export.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,11 +247,20 @@ static bool build_mac_export(export_config *conf, bool print_message) {
bool icon_created = create_mac_icons(conf);
const char *name = conf->title;
const char *zipdir = conf->zipdir;
char *resource_dir = am_format("%s/%s.app/Contents/Resources", zipdir, name);
char *resource_dir;
char *exe_dir;
if (zipdir != NULL) {
resource_dir = am_format("%s/%s.app/Contents/Resources", zipdir, name);
exe_dir = am_format("%s/%s.app/Contents/MacOS", zipdir, name);
} else {
resource_dir = am_format("%s.app/Contents/Resources", name);
exe_dir = am_format("%s.app/Contents/MacOS", name);
}
bool ok =
add_files_to_dist(zipname, am_opt_data_dir, "*.txt", zipdir, NULL, NULL, true, false, ZIP_PLATFORM_UNIX) &&
add_files_to_dist(zipname, binpath, "amulet_license.txt", zipdir, NULL, NULL, true, false, ZIP_PLATFORM_UNIX) &&
add_files_to_dist(zipname, binpath, "amulet", zipdir, name, ".app/Contents/MacOS/amulet", true, true, ZIP_PLATFORM_UNIX) &&
add_files_to_dist(zipname, binpath, "amulet", exe_dir, NULL, NULL, true, true, ZIP_PLATFORM_UNIX) &&
add_files_to_dist(zipname, binpath, "*.dylib", exe_dir, NULL, NULL, true, true, ZIP_PLATFORM_UNIX) &&
add_files_to_dist(zipname, ".", conf->pakfile, zipdir, name, ".app/Contents/Resources/data.pak", false, false, ZIP_PLATFORM_UNIX) &&
add_files_to_dist(zipname, AM_TMP_DIR, "Info.plist", zipdir, name, ".app/Contents/Info.plist", true, false, ZIP_PLATFORM_UNIX) &&
(
Expand All @@ -268,6 +277,7 @@ static bool build_mac_export(export_config *conf, bool print_message) {
free(zipname);
free(binpath);
free(resource_dir);
free(exe_dir);
return ok;
}

Expand Down

0 comments on commit d1fbc99

Please sign in to comment.