bugfix xmake mono
This commit is contained in:
parent
d639159948
commit
008dd45e60
11
src/3rdparty/xmake.lua
vendored
11
src/3rdparty/xmake.lua
vendored
@ -1,8 +1,13 @@
|
||||
--includes("*/xmake.lua")
|
||||
add_requires("gtest")
|
||||
add_requires("vulkansdk",{configs = {utils = {
|
||||
"glslang", "SPIRV", "SPIRV-Tools", "shaderc", "shaderc_shared","shaderc_util", "shaderc_combined",
|
||||
--dumpbin /directives glslang.lib
|
||||
local utils = {
|
||||
"glslang", "SPIRV", "SPIRV-Tools", "shaderc", "shaderc_shared","shaderc_util", "shaderc_combined",
|
||||
"spirv-cross-glsl","spirv-cross-cpp", "spirv-cross-core", "spirv-cross-reflect","spirv-cross-util"
|
||||
}}})
|
||||
}
|
||||
for k,v in ipairs(utils) do
|
||||
utils[k] = v .. "d"
|
||||
end
|
||||
add_requires("vulkansdk",{configs = {utils = utils}})
|
||||
--add_requires("shaderc", "spirv-tools", "glslang", "spirv-cross")
|
||||
add_requires("assimp","freetype","glad","glfw","stb")
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -51,7 +51,11 @@
|
||||
|
||||
namespace idk
|
||||
{
|
||||
|
||||
template<>
|
||||
inline bool GameObject::HasComponent<AspectRatioFitter>() const
|
||||
{
|
||||
return _component_ranges[ComponentID<AspectRatioFitter>].count != 0;
|
||||
}
|
||||
void IGE_InspectorWindow::DisplayComponentInner(Handle<Transform> c_transform)
|
||||
{
|
||||
ImVec2 cursorPos = ImGui::GetCursorPos();
|
||||
|
||||
@ -14,6 +14,7 @@
|
||||
#include <opengl/system/OpenGLGraphicsSystem.h>
|
||||
#include <opengl/resource/OpenGLMesh.h>
|
||||
#include <opengl/resource/OpenGLTexture.h>
|
||||
#include <editor/windows/IGE_IWindow.h>
|
||||
#include <editor/IDE.h>
|
||||
#include <file/FileSystem.h>
|
||||
#include <debug/LogSystem.h>
|
||||
|
||||
@ -62,8 +62,9 @@ namespace idk::mono
|
||||
auto img = mono_assembly_get_image(_assembly);
|
||||
auto klass = mono_class_from_name(img, "idk", "IDK");
|
||||
main = mono_class_get_method_from_name(klass, "Main", 1);
|
||||
void* args[] = { 0 };
|
||||
mono_runtime_invoke(main, nullptr, args, nullptr);
|
||||
const char* args[] = { "arg1", "arg2", "arg3" }; // 传递适当的命令行参数
|
||||
void* p = &args;
|
||||
mono_runtime_invoke(main, nullptr, &p, nullptr);
|
||||
}
|
||||
ScanTypes();
|
||||
|
||||
|
||||
@ -59,11 +59,12 @@ namespace idk::mono
|
||||
|
||||
void ScriptSystem::Init()
|
||||
{
|
||||
auto exe_dir = string{ Core::GetSystem<FileSystem>().GetExeDir() };
|
||||
mono_set_dirs(
|
||||
(exe_dir + "/mono/lib/").data(),
|
||||
(exe_dir + "/mono/etc/").data()
|
||||
);
|
||||
const char* monoPath = getenv("MONO");
|
||||
assert(monoPath);
|
||||
auto& filesys = Core::GetSystem<FileSystem>();
|
||||
filesys.Mount(monoPath, "/mono");
|
||||
mono_set_assemblies_path("mono/lib/mono/4.5");
|
||||
mono_set_dirs(filesys.GetFullPath("/mono/lib/").data(), filesys.GetFullPath("/mono/etc/").data());
|
||||
mono_trace_set_print_handler([](const char* string, [[maybe_unused]] mono_bool is_stdout) {
|
||||
LOG_TO(LogPool::MONO, string);
|
||||
});
|
||||
@ -80,9 +81,10 @@ namespace idk::mono
|
||||
}
|
||||
, nullptr);
|
||||
|
||||
if (Core::GetSystem<FileSystem>().ExistsFull(exe_dir + "/engine_data/idk.dll"))
|
||||
string dll = filesys.GetFullPath("/mono/me/idk.dll");
|
||||
if (Core::GetSystem<FileSystem>().ExistsFull(dll))
|
||||
{
|
||||
main_environment = std::make_unique<MonoWrapperEnvironment>(exe_dir + "/engine_data/idk.dll");
|
||||
main_environment = std::make_unique<MonoWrapperEnvironment>(dll);
|
||||
main_environment->Init();
|
||||
}
|
||||
}
|
||||
@ -93,6 +95,8 @@ namespace idk::mono
|
||||
string{ Core::GetSystem<ProjectManager>().GetProjectDir() } + "/Scripts",
|
||||
"/scripts",
|
||||
true);
|
||||
auto& filesys = Core::GetSystem<FileSystem>();
|
||||
string file = string{ Core::GetSystem<ProjectManager>().GetProjectDir() } + "/Scripts";
|
||||
if (&Core::GetSystem<IEditor>())
|
||||
CompileGameScripts();
|
||||
LoadGameScripts();
|
||||
|
||||
@ -600,7 +600,9 @@ namespace idk::vkn
|
||||
++curr_state;
|
||||
|
||||
//TODO: Submit the command buffers
|
||||
|
||||
if (curr_state >= _pre_states.size()) {
|
||||
curr_state = 0;
|
||||
}
|
||||
vector<vk::CommandBuffer> buffers{};
|
||||
|
||||
if (cameras.size()==0)
|
||||
|
||||
@ -314,10 +314,10 @@ namespace idk::vkn
|
||||
{
|
||||
result.graphics_family = static_cast<uint32_t>(i);
|
||||
}
|
||||
//if (family.queueFlags & vk::QueueFlagBits::eTransfer)
|
||||
//{
|
||||
// result.transfer_family = static_cast<uint32_t>(i);
|
||||
//}
|
||||
if (family.queueFlags & vk::QueueFlagBits::eTransfer)
|
||||
{
|
||||
result.transfer_family = static_cast<uint32_t>(i);
|
||||
}
|
||||
}
|
||||
if (result.isComplete())
|
||||
{
|
||||
|
||||
@ -5,9 +5,9 @@ set_project("idk")
|
||||
set_config("vs_toolset", "14.2")
|
||||
-- 设置 Visual Studio 版本为 2019
|
||||
set_toolchains("msvc")
|
||||
set_runtimes("MD")
|
||||
set_runtimes("MDd")
|
||||
-- 添加 /bigobj 编译选项
|
||||
add_cxflags("/bigobj", "-MD", {force = true})
|
||||
add_cxflags("/bigobj", "-MDd", {force = true})
|
||||
includes("src/xmake.lua")
|
||||
--__std_find_trivial_1 msvc 版本不一致会有这个报错
|
||||
--xmake project -k vsxmake2022 -a x64
|
||||
|
||||
Loading…
Reference in New Issue
Block a user