macOSX Rom path detecttion

This commit is contained in:
jvernet
2021-11-19 12:41:31 +01:00
parent 43039331fc
commit 13371d03bd
3 changed files with 21 additions and 10 deletions

View File

@@ -33,6 +33,7 @@
#ifdef __APPLE__
#include <string.h>
#include <dispatch/dispatch.h>
#include <mac/macOSXGlue.h>
#ifdef __aarch64__
#include <pthread.h>
#endif
@@ -587,12 +588,18 @@ usage:
if (vmrp && (path2[0] == '\0')) {
#ifdef __APPLE__
sprintf("%s/Library/Application Support/86Box/roms", getenv("HOME") ? getenv("HOME") : getpwuid(getuid())->pw_dir);
getDefaultROMPath(path2);
// This will return an absolut path to ~/Library/Application Support/bundleidentifier
#else
strcpy(path2, usr_path);
plat_path_slash(path2);
strcat(path2, "roms");
#endif
/// <summary>
/// TODO: Add Plateform specific getDefaultROMPath to hide the awkfull code below
/// </summary>
/// <param name="path2></param>
/// <returns>Correct Path of Default roms folder</returns>
plat_path_slash(path2);
}

View File

@@ -212,6 +212,9 @@ add_subdirectory(sio)
add_subdirectory(scsi)
add_subdirectory(sound)
add_subdirectory(video)
if(APPLE)
add_subdirectory(mac)
else()
if (WIN32)
add_subdirectory(win)
else()

1
src/mac/CMakeLists.txt Normal file
View File

@@ -0,0 +1 @@
include_directories("./mac")