_maybe prog, trying static linking

This commit is contained in:
2026-03-02 23:39:36 +02:00
parent 1ab600b020
commit 60cdcbcba6
10 changed files with 167 additions and 30 deletions

View File

@@ -311,7 +311,6 @@ void MCore::UnloadDomain(const StringAnsi& domainName)
bool MCore::LoadEngine()
{
LOG(Info, "DotNet MCore::LoadEngine");
PROFILE_CPU();
PROFILE_MEM(ScriptingCSharp);
@@ -1788,7 +1787,6 @@ hostfxr_run_app_fn hostfxr_run_app;
bool InitHostfxr()
{
LOG(Info, "InitHostfxr");
const ::String csharpLibraryPath = Globals::BinariesFolder / TEXT("FlaxEngine.CSharp.dll");
const ::String csharpRuntimeConfigPath = Globals::BinariesFolder / TEXT("FlaxEngine.CSharp.runtimeconfig.json");
if (!FileSystem::FileExists(csharpLibraryPath))
@@ -2063,10 +2061,10 @@ static MonoAssembly* OnMonoAssemblyLoad(const char* aname)
String fileName = name;
if (!name.EndsWith(TEXT(".dll")) && !name.EndsWith(TEXT(".exe")))
fileName += TEXT(".dll");
String path = Globals::ProjectFolder / String(TEXT("/Dotnet/")) / fileName;
String path = Globals::ProjectFolder / String(TEXT("Dotnet/")) / fileName;
if (!FileSystem::FileExists(path))
{
path = Globals::ProjectFolder / String(TEXT("/Dotnet/shared/Microsoft.NETCore.App/")) / fileName;
path = Globals::ProjectFolder / String(TEXT("Dotnet/shared/Microsoft.NETCore.App/")) / fileName;
if (!FileSystem::FileExists(path))
{
path = fileName;
@@ -2219,7 +2217,6 @@ bool MonoAotPreloadTask::Run()
bool InitHostfxr()
{
LOG(Info, "InitHostfxr2");
#if DOTNET_HOST_MONO_DEBUG
// Enable detailed Mono logging
Platform::SetEnvironmentVariable(TEXT("MONO_LOG_LEVEL"), TEXT("debug"));
@@ -2238,8 +2235,7 @@ bool InitHostfxr()
#if defined(USE_MONO_AOT_MODE)
// Enable AOT mode (per-platform)
LOG(Info, "InitHostfxr mono_jit_set_aot_mode");
mono_jit_set_aot_mode(USE_MONO_AOT_MODE);
mono_jit_set_aot_mode(MONO_AOT_MODE_FULL);
#endif
// Platform-specific setup
@@ -2249,7 +2245,6 @@ bool InitHostfxr()
#endif
#ifdef USE_MONO_AOT_MODULE
LOG(Info, "InitHostfxr USE_MONO_AOT_MODULE");
// Wait for AOT module preloading
while (Platform::AtomicRead(&MonoAotPreloadServiceInstance.Ready) == 0)
Platform::Yield();
@@ -2281,7 +2276,6 @@ bool InitHostfxr()
#endif
// Setup debugger
LOG(Info, "InitHostfxr2 setup debugger");
{
int32 debuggerLogLevel = 0;
if (CommandLine::Options.MonoLog.IsTrue() || DOTNET_HOST_MONO_DEBUG)
@@ -2328,7 +2322,6 @@ bool InitHostfxr()
#endif
}
LOG(Info, "InitHostfxr2 set log handler");
// Connect to mono engine callback system
mono_trace_set_log_handler(OnLogCallback, nullptr);
mono_trace_set_print_handler(OnPrintCallback);
@@ -2362,18 +2355,15 @@ bool InitHostfxr()
#else
const char* monoVersion = ""; // ignored
#endif
LOG(Info, "InitHostfxr2 mono_jit_init_version");
MonoDomainHandle = mono_jit_init_version("Flax", monoVersion);
if (!MonoDomainHandle)
{
LOG(Fatal, "Failed to initialize Mono.");
return true;
}
LOG(Info, "InitHostfxr2 mono_gc_init_finalizer_thread");
mono_gc_init_finalizer_thread();
// Log info
LOG(Info, "InitHostfxr2 mono_get_runtime_build_info");
char* buildInfo = mono_get_runtime_build_info();
LOG(Info, "Mono runtime version: {0}", String(buildInfo));
mono_free(buildInfo);

View File

@@ -464,7 +464,6 @@ static void* OnMonoLinuxDlSym(void* handle, const char* name, char** err, void*
bool MCore::LoadEngine()
{
LOG(Info, "Mono MCore::LoadEngine");
PROFILE_CPU();
ASSERT(Globals::MonoPath.IsANSI());

View File

@@ -47,7 +47,6 @@ void MCore::UnloadDomain(const StringAnsi& domainName)
bool MCore::LoadEngine()
{
LOG(Info, "None MCore::LoadEngine");
MRootDomain = New<MDomain>("Root");
MDomains.Add(MRootDomain);
return false;