Fixes for macOS game building

This commit is contained in:
Wojtek Figat
2023-03-30 18:38:58 +02:00
parent aeb0bf700f
commit 4528cce71c
6 changed files with 34 additions and 11 deletions

View File

@@ -278,11 +278,18 @@ bool MCore::LoadEngine()
CallStaticMethodByName<void>(TEXT("Init"));
#ifdef MCORE_MAIN_MODULE_NAME
// MCORE_MAIN_MODULE_NAME define is injected by Scripting.Build.cs on platforms that use separate shared library for engine symbols
const StringAnsi flaxLibraryPath(Platform::GetMainDirectory() / TEXT(MACRO_TO_STR(MCORE_MAIN_MODULE_NAME)));
::String flaxLibraryPath(Platform::GetMainDirectory() / TEXT(MACRO_TO_STR(MCORE_MAIN_MODULE_NAME)));
#else
const StringAnsi flaxLibraryPath(Platform::GetExecutableFilePath());
::String flaxLibraryPath(Platform::GetExecutableFilePath());
#endif
RegisterNativeLibrary("FlaxEngine", flaxLibraryPath.Get());
#if PLATFORM_MAC
// On some platforms all native binaries are side-by-side with the app in a different folder
if (!FileSystem::FileExists(flaxLibraryPath))
{
flaxLibraryPath = ::String(StringUtils::GetDirectoryName(Platform::GetExecutableFilePath())) / StringUtils::GetFileName(flaxLibraryPath);
}
#endif
RegisterNativeLibrary("FlaxEngine", StringAnsi(flaxLibraryPath).Get());
MRootDomain = New<MDomain>("Root");
MDomains.Add(MRootDomain);