From db1938998d1d0b4b95425317f0e06f644da4372c Mon Sep 17 00:00:00 2001 From: ouczbs Date: Thu, 9 May 2024 16:40:30 +0800 Subject: [PATCH] bugfix xmake config --- src/3rdparty/xmake.lua | 3 ++- src/engine/launcher/game_main.cpp | 6 +++--- src/xmake.lua | 8 ++++++-- xmake.lua | 3 ++- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/3rdparty/xmake.lua b/src/3rdparty/xmake.lua index e8f9f29..2e13d04 100644 --- a/src/3rdparty/xmake.lua +++ b/src/3rdparty/xmake.lua @@ -2,5 +2,6 @@ add_requires("gtest") add_requires("vulkansdk","spirv-tools") add_requires("glfw") -add_requires("glslang 1.3.211") +add_requires("shaderc") +add_requires("glslang") add_requires("assimp","freetype","glad","spirv-cross","stb") \ No newline at end of file diff --git a/src/engine/launcher/game_main.cpp b/src/engine/launcher/game_main.cpp index 6194f39..80d602d 100644 --- a/src/engine/launcher/game_main.cpp +++ b/src/engine/launcher/game_main.cpp @@ -289,7 +289,7 @@ ManagedErrorString::ManagedErrorString(DWORD NTStatusMessage, ...) { va_list list; va_start(list, NTStatusMessage); - Hand = LoadLibrary("NTDLL.DLL"); + Hand = LoadLibrary(L"NTDLL.DLL"); numChars = FormatMessage( @@ -306,7 +306,7 @@ ManagedErrorString::ManagedErrorString(DWORD NTStatusMessage, ...) } ManagedErrorString::ManagedErrorString(DWORD NTStatusMessage, int count , DWORD_PTR* test ) { - Hand = LoadLibrary("NTDLL.DLL"); + Hand = LoadLibrary(L"NTDLL.DLL"); numChars = FormatMessage( @@ -423,7 +423,7 @@ void RegisterUnhandledExceptionHandler() auto errStr = ManagedErrorString{ errorCode,2,info->ExceptionRecord->ExceptionInformation[0],info->ExceptionRecord->ExceptionInformation[1] };// , info->ExceptionRecord->NumberParameters, info->ExceptionRecord->ExceptionInformation }; overrideMinHide = true; auto str = GetErrorString(*info->ExceptionRecord); - MessageBox(_hwnd, "SetUnhandledExceptionFilter", "Unhandled Exception", MB_OK); + MessageBox(_hwnd, str.c_str(), L"Unhandled Exception", MB_OK); auto str2 = GetErrorString(*info->ExceptionRecord); auto errStr2 = ManagedErrorString{ errorCode,2,info->ExceptionRecord->ExceptionInformation[0],info->ExceptionRecord->ExceptionInformation[1] };// , info->ExceptionRecord->NumberParameters, info->ExceptionRecord->ExceptionInformation }; auto errStr3 = ManagedErrorString{ errorCode,2,(DWORD_PTR*)info->ExceptionRecord->ExceptionInformation };// , info->ExceptionRecord->NumberParameters, info->ExceptionRecord->ExceptionInformation }; diff --git a/src/xmake.lua b/src/xmake.lua index bb659f2..33cac96 100644 --- a/src/xmake.lua +++ b/src/xmake.lua @@ -22,6 +22,7 @@ target("asset_compiler") target("editor") set_kind("static") + set_languages("cxx20") add_deps("idk","vkn", "opengl","editorstatic", {public = true}) add_includedirs("engine", "engine/editor", {public = true}) add_files("engine/editor/*.cpp","engine/editor/**.cpp") @@ -45,7 +46,10 @@ target("game") target("launcher") set_kind("binary") - add_deps("editor") + add_deps("editor", "win32") + add_syslinks("Xinput") + add_defines([[TEST_DATA_PATH=R"($(ProjectDir)test_data)"]]) + add_defines([[TEST_BIN_DIR=R"($(OutDir))"]]) add_includedirs("engine", "engine/launcher", {public = true}) add_files("engine/launcher/*.cpp") add_headerfiles("engine/launcher/*.h") @@ -62,7 +66,7 @@ target("opengl") target("vkn") set_kind("static") add_deps("idk","win32") - add_packages("vulkansdk","stb", "glslang","spirv-cross", {public = true}) + add_packages("vulkansdk","stb", "glslang","shaderc","spirv-cross", {public = true}) add_includedirs("engine", "engine/vkn", {public = true}) add_files("engine/vkn/*.cpp","engine/vkn/**.cpp") add_headerfiles("engine/vkn/*.h","engine/vkn/**.h") diff --git a/xmake.lua b/xmake.lua index e66135e..e12d277 100644 --- a/xmake.lua +++ b/xmake.lua @@ -7,6 +7,7 @@ set_toolchains("msvc") -- 添加 /bigobj 编译选项 add_cxflags("/bigobj") includes("src/xmake.lua") ---xmake f --vs_toolset=14.2 -c +--__std_find_trivial_1 msvc 版本不一致会有这个报错 +--xmake f --vs_toolset=14.3 -c --xmake project -k vsxmake2022 -a x64 --xmake project -k vsxmake2022 -m "debug;release" \ No newline at end of file