Add editor app packaging for macOS

This commit is contained in:
Wojtek Figat
2023-09-23 14:42:05 +02:00
parent dbbd6ce045
commit f09aebacad
4 changed files with 93 additions and 2 deletions

View File

@@ -108,6 +108,14 @@ int32 Engine::Main(const Char* cmdLine)
Globals::StartupFolder = Globals::BinariesFolder = Platform::GetMainDirectory();
#if USE_EDITOR
Globals::StartupFolder /= TEXT("../../../..");
#if PLATFORM_MAC
if (Globals::BinariesFolder.EndsWith(TEXT(".app/Contents")))
{
// If running editor from application package on macOS
Globals::StartupFolder = Globals::BinariesFolder;
Globals::BinariesFolder /= TEXT("MacOS");
}
#endif
#endif
StringUtils::PathRemoveRelativeParts(Globals::StartupFolder);
FileSystem::NormalizePath(Globals::BinariesFolder);
@@ -125,7 +133,6 @@ int32 Engine::Main(const Char* cmdLine)
}
EngineImpl::InitPaths();
EngineImpl::InitLog();
#if USE_EDITOR
@@ -545,7 +552,8 @@ void EngineImpl::InitLog()
LOG(Info, "Product: {0}, Company: {1}", Globals::ProductName, Globals::CompanyName);
LOG(Info, "Current culture: {0}", Platform::GetUserLocaleName());
LOG(Info, "Command line: {0}", CommandLine);
LOG(Info, "Base directory: {0}", Globals::StartupFolder);
LOG(Info, "Base folder: {0}", Globals::StartupFolder);
LOG(Info, "Binaries folder: {0}", Globals::BinariesFolder);
LOG(Info, "Temporary folder: {0}", Globals::TemporaryFolder);
LOG(Info, "Project folder: {0}", Globals::ProjectFolder);
#if USE_EDITOR