diff options
author | David <25727384+ogniK5377@users.noreply.github.com> | 2019-09-05 04:29:50 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-05 04:29:50 +0200 |
commit | 953d49810a85107c515eec0100fdb7e1fba528f8 (patch) | |
tree | f8a6c3d3d6fa860ac7123db5d28cea9889ea7d03 /src | |
parent | Merge pull request #2802 from ReinUsesLisp/hsetp2-pred (diff) | |
parent | Address review comments (diff) | |
download | yuzu-953d49810a85107c515eec0100fdb7e1fba528f8.tar yuzu-953d49810a85107c515eec0100fdb7e1fba528f8.tar.gz yuzu-953d49810a85107c515eec0100fdb7e1fba528f8.tar.bz2 yuzu-953d49810a85107c515eec0100fdb7e1fba528f8.tar.lz yuzu-953d49810a85107c515eec0100fdb7e1fba528f8.tar.xz yuzu-953d49810a85107c515eec0100fdb7e1fba528f8.tar.zst yuzu-953d49810a85107c515eec0100fdb7e1fba528f8.zip |
Diffstat (limited to 'src')
-rw-r--r-- | src/yuzu/main.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 6d249cb3e..8304c6517 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -6,6 +6,9 @@ #include <clocale> #include <memory> #include <thread> +#ifdef __APPLE__ +#include <unistd.h> // for chdir +#endif // VFS includes must be before glad as they will conflict with Windows file api, which uses defines. #include "applets/error.h" @@ -2226,6 +2229,14 @@ int main(int argc, char* argv[]) { QCoreApplication::setOrganizationName(QStringLiteral("yuzu team")); QCoreApplication::setApplicationName(QStringLiteral("yuzu")); +#ifdef __APPLE__ + // If you start a bundle (binary) on OSX without the Terminal, the working directory is "/". + // But since we require the working directory to be the executable path for the location of the + // user folder in the Qt Frontend, we need to cd into that working directory + const std::string bin_path = FileUtil::GetBundleDirectory() + DIR_SEP + ".."; + chdir(bin_path.c_str()); +#endif + // Enables the core to make the qt created contexts current on std::threads QCoreApplication::setAttribute(Qt::AA_DontCheckOpenGLContextThreadAffinity); QApplication app(argc, argv); |