summaryrefslogtreecommitdiff
path: root/Source/Core/Common/FileUtil.cpp
diff options
context:
space:
mode:
authorspycrab <spycrab@users.noreply.github.com>2019-01-20 02:24:26 +0100
committerspycrab <spycrab@users.noreply.github.com>2019-02-06 20:50:09 +0100
commit63cdebba8830921daf14101e02c2d9590a0343a4 (patch)
tree86b6da78d68fd83d9535645d22440bfb2e021a2c /Source/Core/Common/FileUtil.cpp
parent6a6fc56865cf5ce1a1e5a0f414685ad4d196b716 (diff)
UICommon/AutoUpdate: Add macOS support
Diffstat (limited to 'Source/Core/Common/FileUtil.cpp')
-rw-r--r--Source/Core/Common/FileUtil.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/Source/Core/Common/FileUtil.cpp b/Source/Core/Common/FileUtil.cpp
index fe622ac21a..a631aa3edc 100644
--- a/Source/Core/Common/FileUtil.cpp
+++ b/Source/Core/Common/FileUtil.cpp
@@ -42,6 +42,7 @@
#include <CoreFoundation/CFBundle.h>
#include <CoreFoundation/CFString.h>
#include <CoreFoundation/CFURL.h>
+#include <mach-o/dyld.h>
#include <sys/param.h>
#endif
@@ -683,6 +684,9 @@ std::string GetExePath()
dolphin_path = TStrToUTF8(dolphin_exe_expanded_path);
else
dolphin_path = TStrToUTF8(dolphin_exe_path);
+#elif defined(__APPLE__)
+ dolphin_path = GetBundleDirectory();
+ dolphin_path = dolphin_path.substr(0, dolphin_path.find_last_of("Dolphin.app/Contents/MacOS"));
#else
char dolphin_exe_path[PATH_MAX];
ssize_t len = ::readlink("/proc/self/exe", dolphin_exe_path, sizeof(dolphin_exe_path));