You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-24 15:26:15 +00:00
Merge pull request #12491 from neikeq/waitasecond···
Fix FrameworkPathOverride and assemblies path loop
This commit is contained in:
@@ -97,29 +97,31 @@ def find_msbuild_unix(filename):
|
|||||||
def find_msbuild_windows():
|
def find_msbuild_windows():
|
||||||
import mono_reg_utils as monoreg
|
import mono_reg_utils as monoreg
|
||||||
|
|
||||||
|
bits = env['bits']
|
||||||
|
|
||||||
|
if bits == '32':
|
||||||
|
if os.getenv('MONO32_PREFIX'):
|
||||||
|
mono_root = os.getenv('MONO32_PREFIX')
|
||||||
|
else:
|
||||||
|
mono_root = monoreg.find_mono_root_dir(bits)
|
||||||
|
else:
|
||||||
|
if os.getenv('MONO64_PREFIX'):
|
||||||
|
mono_root = os.getenv('MONO64_PREFIX')
|
||||||
|
else:
|
||||||
|
mono_root = monoreg.find_mono_root_dir(bits)
|
||||||
|
|
||||||
|
if not mono_root:
|
||||||
|
raise RuntimeError('Cannot find mono root directory')
|
||||||
|
|
||||||
msbuild_tools_path = monoreg.find_msbuild_tools_path_reg()
|
msbuild_tools_path = monoreg.find_msbuild_tools_path_reg()
|
||||||
|
|
||||||
if msbuild_tools_path:
|
if msbuild_tools_path:
|
||||||
return (os.path.join(msbuild_tools_path, 'MSBuild.exe'), '')
|
return (os.path.join(msbuild_tools_path, 'MSBuild.exe'), os.path.join(mono_root, 'lib', 'mono', '4.5'))
|
||||||
else:
|
else:
|
||||||
bits = env['bits']
|
msbuild_mono = os.path.join(mono_root, 'bin', 'msbuild.bat')
|
||||||
|
|
||||||
if bits == '32':
|
if os.path.isfile(msbuild_mono):
|
||||||
if os.getenv('MONO32_PREFIX'):
|
return (msbuild_mono, '')
|
||||||
mono_root = os.getenv('MONO32_PREFIX')
|
|
||||||
else:
|
|
||||||
mono_root = monoreg.find_mono_root_dir(bits)
|
|
||||||
else:
|
|
||||||
if os.getenv('MONO64_PREFIX'):
|
|
||||||
mono_root = os.getenv('MONO64_PREFIX')
|
|
||||||
else:
|
|
||||||
mono_root = monoreg.find_mono_root_dir(bits)
|
|
||||||
|
|
||||||
if mono_root:
|
|
||||||
msbuild_mono = os.path.join(mono_root, 'bin', 'msbuild.bat')
|
|
||||||
|
|
||||||
if os.path.isfile(msbuild_mono):
|
|
||||||
return (msbuild_mono, os.path.join(mono_root, 'lib', 'mono', '4.5'))
|
|
||||||
|
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|||||||
@@ -32,6 +32,7 @@
|
|||||||
#include "main/main.h"
|
#include "main/main.h"
|
||||||
|
|
||||||
#include "../godotsharp_dirs.h"
|
#include "../godotsharp_dirs.h"
|
||||||
|
#include "../mono_gd/gd_mono.h"
|
||||||
#include "../mono_gd/gd_mono_class.h"
|
#include "../mono_gd/gd_mono_class.h"
|
||||||
#include "../mono_gd/gd_mono_marshal.h"
|
#include "../mono_gd/gd_mono_marshal.h"
|
||||||
#include "../utils/path_utils.h"
|
#include "../utils/path_utils.h"
|
||||||
@@ -84,10 +85,16 @@ void godot_icall_BuildInstance_get_MSBuildInfo(MonoString **r_msbuild_path, Mono
|
|||||||
if (!msbuild_tools_path.ends_with("\\"))
|
if (!msbuild_tools_path.ends_with("\\"))
|
||||||
msbuild_tools_path += "\\";
|
msbuild_tools_path += "\\";
|
||||||
|
|
||||||
*r_msbuild_path = GDMonoMarshal::mono_string_from_godot(msbuild_tools_path + "MSBuild.exe");
|
|
||||||
|
|
||||||
// FrameworkPathOverride
|
// FrameworkPathOverride
|
||||||
*r_framework_path = GDMonoMarshal::mono_string_from_godot(GDMono::get_singleton()->get_mono_reg_info().assembly_dir);
|
const MonoRegInfo &mono_reg_info = GDMono::get_singleton()->get_mono_reg_info();
|
||||||
|
if (mono_reg_info.assembly_dir.length()) {
|
||||||
|
*r_msbuild_path = GDMonoMarshal::mono_string_from_godot(msbuild_tools_path + "MSBuild.exe");
|
||||||
|
|
||||||
|
String framework_path = path_join(mono_reg_info.assembly_dir, "mono", "4.5");
|
||||||
|
*r_framework_path = GDMonoMarshal::mono_string_from_godot(framework_path);
|
||||||
|
} else {
|
||||||
|
ERR_PRINT("Cannot find Mono's assemblies directory in the registry");
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -130,6 +137,7 @@ void godot_icall_BuildInstance_get_MSBuildInfo(MonoString **r_msbuild_path, Mono
|
|||||||
|
|
||||||
return;
|
return;
|
||||||
#else
|
#else
|
||||||
|
ERR_PRINT("Not implemented on this platform");
|
||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -107,10 +107,11 @@ MonoAssembly *GDMonoAssembly::_preload_hook(MonoAssemblyName *aname, char **asse
|
|||||||
search_dirs.push_back(String(rootdir).plus_file("mono").plus_file("4.5"));
|
search_dirs.push_back(String(rootdir).plus_file("mono").plus_file("4.5"));
|
||||||
}
|
}
|
||||||
|
|
||||||
while (assemblies_path) {
|
if (assemblies_path) {
|
||||||
if (*assemblies_path)
|
while (*assemblies_path) {
|
||||||
search_dirs.push_back(*assemblies_path);
|
search_dirs.push_back(*assemblies_path);
|
||||||
++assemblies_path;
|
++assemblies_path;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user