From 691b54f9f00950ae013694a568145ee79d1ba440 Mon Sep 17 00:00:00 2001 From: "U-WIN-6O36QGINL6D\\abcgg" Date: Sat, 17 Jun 2023 20:59:41 +0800 Subject: [PATCH 01/14] add premake5 modules --- .gitmodules | 6 ++++++ premake5-modules/premake-vspropertysheet | 1 + premake5-modules/premake-wkslight | 1 + 3 files changed, 8 insertions(+) create mode 100644 .gitmodules create mode 160000 premake5-modules/premake-vspropertysheet create mode 160000 premake5-modules/premake-wkslight diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000..113637c79 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,6 @@ +[submodule "premake5-modules/premake-vspropertysheet"] + path = premake5-modules/premake-vspropertysheet + url = https://github.com/ignite720/premake-vspropertysheet.git +[submodule "premake5-modules/premake-wkslight"] + path = premake5-modules/premake-wkslight + url = https://github.com/ignite720/premake-wkslight.git diff --git a/premake5-modules/premake-vspropertysheet b/premake5-modules/premake-vspropertysheet new file mode 160000 index 000000000..ad46e61d8 --- /dev/null +++ b/premake5-modules/premake-vspropertysheet @@ -0,0 +1 @@ +Subproject commit ad46e61d89a82e57574672470cb7a3f475db3250 diff --git a/premake5-modules/premake-wkslight b/premake5-modules/premake-wkslight new file mode 160000 index 000000000..d4df159ce --- /dev/null +++ b/premake5-modules/premake-wkslight @@ -0,0 +1 @@ +Subproject commit d4df159ced3d37068d5dd312be063e82c0b97db1 From 8594b30aa6cfc3b880ec7a5ce8148de7f6c44eea Mon Sep 17 00:00:00 2001 From: "U-WIN-6O36QGINL6D\\abcgg" Date: Sat, 17 Jun 2023 23:07:11 +0800 Subject: [PATCH 02/14] Fixed issue of editor crashing when starting in release mode --- VEngine/Code/Asset/AssetSystem.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/VEngine/Code/Asset/AssetSystem.cpp b/VEngine/Code/Asset/AssetSystem.cpp index 89f537b96..17f288297 100644 --- a/VEngine/Code/Asset/AssetSystem.cpp +++ b/VEngine/Code/Asset/AssetSystem.cpp @@ -183,12 +183,12 @@ MeshDataProxy AssetSystem::ReadVMeshAssetFromFile(const std::string filename) MeshAssetHeader header; MeshData data; - assert(fread(&header, sizeof(MeshAssetHeader), 1, file)); + fread(&header, sizeof(MeshAssetHeader), 1, file); data.vertices.resize(header.vertexCount); - assert(fread(data.vertices.data(), sizeof(Vertex), header.vertexCount, file)); + fread(data.vertices.data(), sizeof(Vertex), header.vertexCount, file); - assert(fread(&data.boundingBox, sizeof(DirectX::BoundingBox), 1, file)); + fread(&data.boundingBox, sizeof(DirectX::BoundingBox), 1, file); data.skeleton.GetJoints().resize(header.boneCount); //Has to potential to read empty data, don't call assert() @@ -217,22 +217,22 @@ Animation AssetSystem::ReadVAnimAssetFromFile(const std::string filename) AnimationAssetHeader header; - assert(fread(&header, sizeof(AnimationAssetHeader), 1, file)); + fread(&header, sizeof(AnimationAssetHeader), 1, file); Animation anim = Animation(header.name); for (uint64_t i = 0; i < header.frameCount; i++) { int jointIndex = Joint::INVALID_JOINT_INDEX; - assert(fread(&jointIndex, sizeof(int), 1, file)); + fread(&jointIndex, sizeof(int), 1, file); assert(jointIndex != -2); size_t animFrameCount = 0; - assert(fread(&animFrameCount, sizeof(size_t), 1, file)); + fread(&animFrameCount, sizeof(size_t), 1, file); std::vector animFrames; animFrames.resize(animFrameCount); - assert(fread(animFrames.data(), sizeof(AnimFrame) * animFrameCount, 1, file)); + fread(animFrames.data(), sizeof(AnimFrame) * animFrameCount, 1, file); anim.AddFrame(jointIndex, animFrames); } From 188c2198c5a8b4c570cd7653d8e9af212eb4be12 Mon Sep 17 00:00:00 2001 From: "U-WIN-6O36QGINL6D\\abcgg" Date: Sat, 17 Jun 2023 23:34:12 +0800 Subject: [PATCH 03/14] ignore the build folder generated by premake5 --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index b56bba0a8..ed5cf02e1 100644 --- a/.gitignore +++ b/.gitignore @@ -8,7 +8,8 @@ VEngine/Code/FbxSdk/ VEngine/Code/Physx/ VEngine/Shaders/Vertex/ VEngine/Shaders/Pixel/ - +[Bb]uild + # User-specific files *.dll *.lib From 4f68b45c3e10ee935951255cc5eb9d98c8f21a28 Mon Sep 17 00:00:00 2001 From: "U-WIN-6O36QGINL6D\\abcgg" Date: Sat, 17 Jun 2023 23:36:20 +0800 Subject: [PATCH 04/14] added support for premake5 --- VEngine/premake5.lua | 74 +++++++++++++++++++++++++++++++++++++ premake5-clean.bat | 3 ++ premake5-generate-gmake.bat | 3 ++ premake5-generate.bat | 3 ++ premake5-wkslight.lua | 18 +++++++++ premake5.lua | 44 ++++++++++++++++++++++ 6 files changed, 145 insertions(+) create mode 100644 VEngine/premake5.lua create mode 100644 premake5-clean.bat create mode 100644 premake5-generate-gmake.bat create mode 100644 premake5-generate.bat create mode 100644 premake5-wkslight.lua create mode 100644 premake5.lua diff --git a/VEngine/premake5.lua b/VEngine/premake5.lua new file mode 100644 index 000000000..e0228883c --- /dev/null +++ b/VEngine/premake5.lua @@ -0,0 +1,74 @@ +project("VEngine") + location(g_wkslight.workspacedir .. "/%{prj.name}") + targetdir(g_wkslight.targetdir) + debugdir("") + debugargs({ "" }) + kind("ConsoleApp") + language("C++") + pchheader("vpch.h") + pchsource("Code/vpch.cpp") + files({ + "Code/**.h", + "Code/**.cpp", + "Code/**.hlsl", + }) + removefiles({ + "Code/Editor/imgui/backends/**.*", + "Code/Editor/imgui/examples/**.*", + "Code/Editor/imgui/misc/**.*", + "Code/Editor/ImGuizmo/example/**.*", + "Code/Editor/ImGuizmo/vcpkg-example/**.*", + }) + files({ + "Code/Editor/imgui/backends/imgui_impl_dx11.cpp", + "Code/Editor/imgui/backends/imgui_impl_win32.cpp", + }) + includedirs({ + "Code", + "Code/Editor/imgui", + "Code/Editor/ImGuizmo", + }) + links({ + "d3d11.lib", + "dxgi.lib", + "d3dcompiler.lib", + "d2d1.lib", + "dwrite.lib", + }) + defines({ + --"_USE_MATH_DEFINES", + }) + filter("files:Code/Editor/imgui/**.cpp") + flags({ "NoPCH" }) + filter("files:Code/Editor/ImGuizmo/**.cpp") + flags({ "NoPCH" }) + filter("files:Code/SHMath/**.cpp") + flags({ "NoPCH" }) + filter("files:Code/**.hlsl") + flags({ "ExcludeFromBuild" }) + shadermodel("5.0") + shaderobjectfileoutput("%{wks.location}/../%{prj.name}/Shaders/%{file.basename}.cso") + filter("files:Code/Render/Shaders/Vertex/*.hlsl") + removeflags({ "ExcludeFromBuild" }) + shadertype("Vertex") + shaderobjectfileoutput("%{wks.location}/../%{prj.name}/Shaders/Vertex/%{file.basename}.cso") + filter("files:Code/Render/Shaders/Pixel/*.hlsl") + removeflags({ "ExcludeFromBuild" }) + shadertype("Pixel") + shaderobjectfileoutput("%{wks.location}/../%{prj.name}/Shaders/Pixel/%{file.basename}.cso") + filter("files:Code/Render/Shaders/Compute/*CS.hlsl") + removeflags({ "ExcludeFromBuild" }) + shadertype("Compute") + shaderentry("CSFunc") + --shaderoptions({ "/E 'CSFunc'" }) + filter("action:vs*") + debugenvs({ + "$(LocalDebuggerEnvironment)", + "QT_QPA_PLATFORM_PLUGIN_PATH=" .. g_wkslight.extras.qt_root .. "\\plugins\\platforms", + }) + vspropertysheet({ + "D:\\dev2\\DirectXTK.props", + "D:\\dev2\\fbxsdk.props", + "D:\\dev2\\PhysX-4.1.props", + "D:\\dev2\\qt5.props", + }) \ No newline at end of file diff --git a/premake5-clean.bat b/premake5-clean.bat new file mode 100644 index 000000000..eec7917b9 --- /dev/null +++ b/premake5-clean.bat @@ -0,0 +1,3 @@ +@echo off +@call "premake5.exe" clean +@ping -n 2 127.0.0.1>nul \ No newline at end of file diff --git a/premake5-generate-gmake.bat b/premake5-generate-gmake.bat new file mode 100644 index 000000000..0e5ff6956 --- /dev/null +++ b/premake5-generate-gmake.bat @@ -0,0 +1,3 @@ +@echo off +@call "premake5.exe" gmake +@ping -n 2 127.0.0.1>nul \ No newline at end of file diff --git a/premake5-generate.bat b/premake5-generate.bat new file mode 100644 index 000000000..cd9c3fdf8 --- /dev/null +++ b/premake5-generate.bat @@ -0,0 +1,3 @@ +@echo off +@call "premake5.exe" vs2022 +@ping -n 2 127.0.0.1>nul \ No newline at end of file diff --git a/premake5-wkslight.lua b/premake5-wkslight.lua new file mode 100644 index 000000000..d1ec1150e --- /dev/null +++ b/premake5-wkslight.lua @@ -0,0 +1,18 @@ +g_wkslight = require("premake5-modules.premake-wkslight.wkslight") +g_wkslight.workspace = { + name = "VEngine-wks", + startproject = "", + platforms = { "x64" }, + cppdialect = "C++20", + thirdparty = { + name = "thirdparty", + projects = { + }, + }, + projects = { + "VEngine", + }, +} +g_wkslight.extras = { + qt_root = "D:\\dev2\\qt-5.15.2", +} \ No newline at end of file diff --git a/premake5.lua b/premake5.lua new file mode 100644 index 000000000..c86b700e1 --- /dev/null +++ b/premake5.lua @@ -0,0 +1,44 @@ +require("premake5-modules.premake-vspropertysheet.vspropertysheet") +require("premake5-wkslight") +workspace(g_wkslight.workspace.name) + location(path.getbasename(g_wkslight.workspacedir)) + platforms(g_wkslight.workspace.platforms) + configurations({ "Debug", "Release" }) + characterset("Default") + cppdialect(g_wkslight.workspace.cppdialect) + floatingpoint("Default") + rtti("Default") + exceptionhandling("Default") + filter("system:windows") + systemversion("latest") + filter("system:linux") + pic("On") + filter("action:vs*") + startproject(g_wkslight.workspace.startproject) + staticruntime("Off") + characterset("MBCS") + flags({ "MultiProcessorCompile" }) + defines({ + "_CRT_SECURE_NO_WARNINGS", + "_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS", + "_HAS_STD_BYTE=0", + }) + --buildoptions({ "/utf-8", "/Zc:char8_t-" }) + filter("action:gmake*") + buildoptions({ "-static" }) + filter("configurations:Debug") + defines({ "_DEBUG" }) + symbols("On") + optimize("Off") + filter("configurations:Release") + defines({ "NDEBUG" }) + symbols("Off") + optimize("Speed") +group(g_wkslight.workspace.thirdparty.name) + for k, v in pairs(g_wkslight.workspace.thirdparty.projects) do + include(v.location) + end +group("") + for i, v in ipairs(g_wkslight.workspace.projects) do + include(v) + end \ No newline at end of file From 6d630ba794fe8c297eb2e8960a69c0c5da579b57 Mon Sep 17 00:00:00 2001 From: "U-WIN-6O36QGINL6D\\abcgg" Date: Mon, 19 Jun 2023 15:18:53 +0800 Subject: [PATCH 05/14] Updated submodule --- .gitmodules | 6 +++--- premake5-modules/premake-vspropertysheet | 1 - premake5-modules/premake-vspropertysheets | 1 + 3 files changed, 4 insertions(+), 4 deletions(-) delete mode 160000 premake5-modules/premake-vspropertysheet create mode 160000 premake5-modules/premake-vspropertysheets diff --git a/.gitmodules b/.gitmodules index 113637c79..66a05a9b7 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,6 @@ -[submodule "premake5-modules/premake-vspropertysheet"] - path = premake5-modules/premake-vspropertysheet - url = https://github.com/ignite720/premake-vspropertysheet.git [submodule "premake5-modules/premake-wkslight"] path = premake5-modules/premake-wkslight url = https://github.com/ignite720/premake-wkslight.git +[submodule "premake5-modules/premake-vspropertysheets"] + path = premake5-modules/premake-vspropertysheets + url = https://github.com/ignite720/premake-vspropertysheets.git diff --git a/premake5-modules/premake-vspropertysheet b/premake5-modules/premake-vspropertysheet deleted file mode 160000 index ad46e61d8..000000000 --- a/premake5-modules/premake-vspropertysheet +++ /dev/null @@ -1 +0,0 @@ -Subproject commit ad46e61d89a82e57574672470cb7a3f475db3250 diff --git a/premake5-modules/premake-vspropertysheets b/premake5-modules/premake-vspropertysheets new file mode 160000 index 000000000..a249dfcfc --- /dev/null +++ b/premake5-modules/premake-vspropertysheets @@ -0,0 +1 @@ +Subproject commit a249dfcfc241f3f0470c58717f266cff1fcb591d From e972504c306fac5cb5d45ccc952034350f5ac02e Mon Sep 17 00:00:00 2001 From: "U-WIN-6O36QGINL6D\\abcgg" Date: Mon, 19 Jun 2023 15:51:06 +0800 Subject: [PATCH 06/14] Updated premake5 related scripts --- .gitignore | 3 ++- VEngine/premake5.lua | 2 +- premake5-clean.bat | 4 ++-- premake5-generate-gmake.bat | 4 ++-- premake5-generate.bat | 4 ++-- premake5.lua | 4 ++-- 6 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index ed5cf02e1..4109bcb9f 100644 --- a/.gitignore +++ b/.gitignore @@ -8,7 +8,8 @@ VEngine/Code/FbxSdk/ VEngine/Code/Physx/ VEngine/Shaders/Vertex/ VEngine/Shaders/Pixel/ -[Bb]uild + +[Bb]uild/ # User-specific files *.dll diff --git a/VEngine/premake5.lua b/VEngine/premake5.lua index e0228883c..f89fb5361 100644 --- a/VEngine/premake5.lua +++ b/VEngine/premake5.lua @@ -66,7 +66,7 @@ project("VEngine") "$(LocalDebuggerEnvironment)", "QT_QPA_PLATFORM_PLUGIN_PATH=" .. g_wkslight.extras.qt_root .. "\\plugins\\platforms", }) - vspropertysheet({ + vspropertysheets({ "D:\\dev2\\DirectXTK.props", "D:\\dev2\\fbxsdk.props", "D:\\dev2\\PhysX-4.1.props", diff --git a/premake5-clean.bat b/premake5-clean.bat index eec7917b9..b57262c94 100644 --- a/premake5-clean.bat +++ b/premake5-clean.bat @@ -1,3 +1,3 @@ @echo off -@call "premake5.exe" clean -@ping -n 2 127.0.0.1>nul \ No newline at end of file +call "premake5.exe" clean +ping -n 2 127.0.0.1>nul \ No newline at end of file diff --git a/premake5-generate-gmake.bat b/premake5-generate-gmake.bat index 0e5ff6956..5443d734f 100644 --- a/premake5-generate-gmake.bat +++ b/premake5-generate-gmake.bat @@ -1,3 +1,3 @@ @echo off -@call "premake5.exe" gmake -@ping -n 2 127.0.0.1>nul \ No newline at end of file +call "premake5.exe" gmake +ping -n 2 127.0.0.1>nul \ No newline at end of file diff --git a/premake5-generate.bat b/premake5-generate.bat index cd9c3fdf8..e7ad7bbbb 100644 --- a/premake5-generate.bat +++ b/premake5-generate.bat @@ -1,3 +1,3 @@ @echo off -@call "premake5.exe" vs2022 -@ping -n 2 127.0.0.1>nul \ No newline at end of file +call "premake5.exe" vs2022 +ping -n 2 127.0.0.1>nul \ No newline at end of file diff --git a/premake5.lua b/premake5.lua index c86b700e1..718844245 100644 --- a/premake5.lua +++ b/premake5.lua @@ -1,4 +1,4 @@ -require("premake5-modules.premake-vspropertysheet.vspropertysheet") +require("premake5-modules.premake-vspropertysheets.vspropertysheets") require("premake5-wkslight") workspace(g_wkslight.workspace.name) location(path.getbasename(g_wkslight.workspacedir)) @@ -24,7 +24,7 @@ workspace(g_wkslight.workspace.name) "_HAS_STD_BYTE=0", }) --buildoptions({ "/utf-8", "/Zc:char8_t-" }) - filter("action:gmake*") + filter({ "system:not linux", "action:gmake*", "kind:*App or StaticLib" }) buildoptions({ "-static" }) filter("configurations:Debug") defines({ "_DEBUG" }) From f2518e795d9760f7359709b14fef58245a8f98b5 Mon Sep 17 00:00:00 2001 From: "U-WIN-6O36QGINL6D\\abcgg" Date: Mon, 19 Jun 2023 17:36:34 +0800 Subject: [PATCH 07/14] Remove the old sub module premake-wkslight --- .gitmodules | 3 --- premake5-modules/premake-wkslight | 1 - 2 files changed, 4 deletions(-) delete mode 160000 premake5-modules/premake-wkslight diff --git a/.gitmodules b/.gitmodules index 66a05a9b7..180c3d7f5 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,3 @@ -[submodule "premake5-modules/premake-wkslight"] - path = premake5-modules/premake-wkslight - url = https://github.com/ignite720/premake-wkslight.git [submodule "premake5-modules/premake-vspropertysheets"] path = premake5-modules/premake-vspropertysheets url = https://github.com/ignite720/premake-vspropertysheets.git diff --git a/premake5-modules/premake-wkslight b/premake5-modules/premake-wkslight deleted file mode 160000 index d4df159ce..000000000 --- a/premake5-modules/premake-wkslight +++ /dev/null @@ -1 +0,0 @@ -Subproject commit d4df159ced3d37068d5dd312be063e82c0b97db1 From 9b70fb2c121673f4b56e0f1e650090509ff307ec Mon Sep 17 00:00:00 2001 From: "U-WIN-6O36QGINL6D\\abcgg" Date: Mon, 19 Jun 2023 17:53:28 +0800 Subject: [PATCH 08/14] Updated submodule --- .gitmodules | 3 +++ premake5-modules/premake-wkslight | 1 + 2 files changed, 4 insertions(+) create mode 160000 premake5-modules/premake-wkslight diff --git a/.gitmodules b/.gitmodules index 180c3d7f5..0b5be4e89 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "premake5-modules/premake-vspropertysheets"] path = premake5-modules/premake-vspropertysheets url = https://github.com/ignite720/premake-vspropertysheets.git +[submodule "premake5-modules/premake-wkslight"] + path = premake5-modules/premake-wkslight + url = https://github.com/ignite720/premake-wkslight.git diff --git a/premake5-modules/premake-wkslight b/premake5-modules/premake-wkslight new file mode 160000 index 000000000..c7b8e162b --- /dev/null +++ b/premake5-modules/premake-wkslight @@ -0,0 +1 @@ +Subproject commit c7b8e162b44e74df8f9013822c0a46f4f44554e0 From 2bae2750ccb1cfe22fbf98c98cc2b292f76b8e47 Mon Sep 17 00:00:00 2001 From: "U-WIN-6O36QGINL6D\\abcgg" Date: Mon, 19 Jun 2023 18:26:06 +0800 Subject: [PATCH 09/14] Updated premake5 script --- premake5.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/premake5.lua b/premake5.lua index 718844245..d9307ac27 100644 --- a/premake5.lua +++ b/premake5.lua @@ -24,7 +24,7 @@ workspace(g_wkslight.workspace.name) "_HAS_STD_BYTE=0", }) --buildoptions({ "/utf-8", "/Zc:char8_t-" }) - filter({ "system:not linux", "action:gmake*", "kind:*App or StaticLib" }) + filter({ "action:gmake*", "system:not linux", "kind:*App or StaticLib" }) buildoptions({ "-static" }) filter("configurations:Debug") defines({ "_DEBUG" }) From 8d8415441e14366ec97d0c81acd53e07447ee03d Mon Sep 17 00:00:00 2001 From: "U-WIN-6O36QGINL6D\\abcgg" Date: Tue, 20 Jun 2023 16:39:09 +0800 Subject: [PATCH 10/14] Changed to another alternative of sleep(2) --- premake5-clean.bat | 2 +- premake5-generate-gmake.bat | 2 +- premake5-generate.bat | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/premake5-clean.bat b/premake5-clean.bat index b57262c94..8f6aae86e 100644 --- a/premake5-clean.bat +++ b/premake5-clean.bat @@ -1,3 +1,3 @@ @echo off call "premake5.exe" clean -ping -n 2 127.0.0.1>nul \ No newline at end of file +timeout /t 2 > nul \ No newline at end of file diff --git a/premake5-generate-gmake.bat b/premake5-generate-gmake.bat index 5443d734f..66643a728 100644 --- a/premake5-generate-gmake.bat +++ b/premake5-generate-gmake.bat @@ -1,3 +1,3 @@ @echo off call "premake5.exe" gmake -ping -n 2 127.0.0.1>nul \ No newline at end of file +timeout /t 2 > nul \ No newline at end of file diff --git a/premake5-generate.bat b/premake5-generate.bat index e7ad7bbbb..1a063eb40 100644 --- a/premake5-generate.bat +++ b/premake5-generate.bat @@ -1,3 +1,3 @@ @echo off call "premake5.exe" vs2022 -ping -n 2 127.0.0.1>nul \ No newline at end of file +timeout /t 2 > nul \ No newline at end of file From b852ae11c696f20fb178d2b899ad7fd16cfc1f42 Mon Sep 17 00:00:00 2001 From: "U-WIN-6O36QGINL6D\\abcgg" Date: Tue, 20 Jun 2023 19:33:12 +0800 Subject: [PATCH 11/14] Updated premake5 qt config --- VEngine/premake5.lua | 2 +- premake5-wkslight.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/VEngine/premake5.lua b/VEngine/premake5.lua index f89fb5361..257e981e2 100644 --- a/VEngine/premake5.lua +++ b/VEngine/premake5.lua @@ -64,7 +64,7 @@ project("VEngine") filter("action:vs*") debugenvs({ "$(LocalDebuggerEnvironment)", - "QT_QPA_PLATFORM_PLUGIN_PATH=" .. g_wkslight.extras.qt_root .. "\\plugins\\platforms", + "QT_QPA_PLATFORM_PLUGIN_PATH=" .. g_wkslight.extras.qt_qpa_platform_plugin_path, }) vspropertysheets({ "D:\\dev2\\DirectXTK.props", diff --git a/premake5-wkslight.lua b/premake5-wkslight.lua index d1ec1150e..bb73c613f 100644 --- a/premake5-wkslight.lua +++ b/premake5-wkslight.lua @@ -14,5 +14,5 @@ g_wkslight.workspace = { }, } g_wkslight.extras = { - qt_root = "D:\\dev2\\qt-5.15.2", + qt_qpa_platform_plugin_path = "D:\\dev2\\qt-5.15.2\\plugins\\platforms", } \ No newline at end of file From e57a322d39dee0ffde90ef2cbe5665a0d5957f95 Mon Sep 17 00:00:00 2001 From: "U-WIN-6O36QGINL6D\\abcgg" Date: Wed, 21 Jun 2023 22:56:23 +0800 Subject: [PATCH 12/14] Added example staticlib --- Editor/premake5.lua | 18 ++++++++++++++++++ Editor/src/main.cpp | 8 ++++++++ .../include/ExampleStaticLib.h | 9 +++++++++ libraries/ExampleStaticLib/premake5.lua | 12 ++++++++++++ .../ExampleStaticLib/src/ExampleStaticLib.cpp | 6 ++++++ premake5-wkslight.lua | 13 ++++++++++--- premake5.lua | 4 ++-- 7 files changed, 65 insertions(+), 5 deletions(-) create mode 100644 Editor/premake5.lua create mode 100644 Editor/src/main.cpp create mode 100644 libraries/ExampleStaticLib/include/ExampleStaticLib.h create mode 100644 libraries/ExampleStaticLib/premake5.lua create mode 100644 libraries/ExampleStaticLib/src/ExampleStaticLib.cpp diff --git a/Editor/premake5.lua b/Editor/premake5.lua new file mode 100644 index 000000000..b33f3a64b --- /dev/null +++ b/Editor/premake5.lua @@ -0,0 +1,18 @@ +project("Editor") + location(g_wkslight.workspacedir .. "/%{prj.name}") + targetdir(g_wkslight.targetdir) + debugdir("") + debugargs({ "" }) + kind("ConsoleApp") + language("C++") + files({ + "src/**.h", + "src/**.cpp", + }) + includedirs({ + "src", + g_wkslight.workspace.libraries.projects.ExampleStaticLib.includedirs, + }) + links({ + "ExampleStaticLib", + }) \ No newline at end of file diff --git a/Editor/src/main.cpp b/Editor/src/main.cpp new file mode 100644 index 000000000..68a0204e8 --- /dev/null +++ b/Editor/src/main.cpp @@ -0,0 +1,8 @@ +#include + +int main(int argc, char *argv[]) +{ + ExampleStaticLib example; + example.Print(); + return 0; +} diff --git a/libraries/ExampleStaticLib/include/ExampleStaticLib.h b/libraries/ExampleStaticLib/include/ExampleStaticLib.h new file mode 100644 index 000000000..b32a9d150 --- /dev/null +++ b/libraries/ExampleStaticLib/include/ExampleStaticLib.h @@ -0,0 +1,9 @@ +#pragma once + +#include + +class ExampleStaticLib +{ +public: + void Print(); +}; \ No newline at end of file diff --git a/libraries/ExampleStaticLib/premake5.lua b/libraries/ExampleStaticLib/premake5.lua new file mode 100644 index 000000000..c5069bc60 --- /dev/null +++ b/libraries/ExampleStaticLib/premake5.lua @@ -0,0 +1,12 @@ +project("ExampleStaticLib") + location(g_wkslight.workspacedir .. "/%{prj.name}") + targetdir(g_wkslight.targetdir) + kind("StaticLib") + language("C++") + files({ + "include/**.h", + "src/**.cpp", + }) + includedirs({ + g_wkslight.workspace.libraries.projects.ExampleStaticLib.includedirs, + }) \ No newline at end of file diff --git a/libraries/ExampleStaticLib/src/ExampleStaticLib.cpp b/libraries/ExampleStaticLib/src/ExampleStaticLib.cpp new file mode 100644 index 000000000..6986b3673 --- /dev/null +++ b/libraries/ExampleStaticLib/src/ExampleStaticLib.cpp @@ -0,0 +1,6 @@ +#include "ExampleStaticLib.h" + +void ExampleStaticLib::Print() +{ + printf("ExampleStaticLib: Hello\n"); +} \ No newline at end of file diff --git a/premake5-wkslight.lua b/premake5-wkslight.lua index bb73c613f..cd5fe3a08 100644 --- a/premake5-wkslight.lua +++ b/premake5-wkslight.lua @@ -1,15 +1,22 @@ g_wkslight = require("premake5-modules.premake-wkslight.wkslight") g_wkslight.workspace = { name = "VEngine-wks", - startproject = "", + startproject = "VEngine", platforms = { "x64" }, cppdialect = "C++20", - thirdparty = { - name = "thirdparty", + libraries = { + name = "libraries", projects = { + ExampleStaticLib = { + location = "libraries/ExampleStaticLib", + includedirs = { + "%{wks.location}/../libraries/ExampleStaticLib/include", + }, + }, }, }, projects = { + "Editor", "VEngine", }, } diff --git a/premake5.lua b/premake5.lua index d9307ac27..5f5db6d62 100644 --- a/premake5.lua +++ b/premake5.lua @@ -34,8 +34,8 @@ workspace(g_wkslight.workspace.name) defines({ "NDEBUG" }) symbols("Off") optimize("Speed") -group(g_wkslight.workspace.thirdparty.name) - for k, v in pairs(g_wkslight.workspace.thirdparty.projects) do +group(g_wkslight.workspace.libraries.name) + for k, v in pairs(g_wkslight.workspace.libraries.projects) do include(v.location) end group("") From 9caeb67e109517ac0fa2ac940e3a5f6293f4c2cb Mon Sep 17 00:00:00 2001 From: "U-WIN-6O36QGINL6D\\abcgg" Date: Thu, 22 Jun 2023 22:17:05 +0800 Subject: [PATCH 13/14] Added a basic CI --- .github/workflows/ci.yml | 51 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..f0f618b3f --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,51 @@ +name: CI + +on: + pull_request: + branches: [ "main", "master" ] + + workflow_dispatch: + +jobs: + build: + runs-on: windows-latest + steps: + - uses: actions/checkout@v3 + with: + submodules: "recursive" + + - name: Clone dev2 + run: | + git -C D:\ clone https://github.com/ignite720/dev2.git + + - name: Setup premake5 + uses: abel0b/setup-premake@v2.2 + with: + version: "5.0.0-beta2" + + - name: Add msbuild to PATH + uses: microsoft/setup-msbuild@v1.1 + with: + vs-version: "latest" + + - name: Build app for release + run: | + premake5 vs2022 + msbuild build\VEngine-wks.sln -nologo -m -p:Configuration=Release /p:Platform=x64 /p:Projects="build\VEngine\VEngine.vcxproj" + + - name: Create artifact + run: | + mkdir -p temp/artifact + cp bin/x64/Release/*.exe temp/artifact/ + #cp -R VEngine/Assets temp/artifact/ + cp -R VEngine/Shaders temp/artifact/ + cp D:/dev2/fbxsdk202032/lib/vs2017/x64/release/*.dll temp/artifact/ + cp D:/dev2/PhysX.4.1.229882250/bin/Release/*.dll temp/artifact/ + cp D:/dev2/qt-5.15.2/bin/*.dll temp/artifact/ + cp -R D:/dev2/qt-5.15.2/plugins temp/artifact/ + + - name: Upload artifact + uses: actions/upload-artifact@v3 + with: + name: Release-Artifact + path: temp From d8d3e1cf6b0d4eb16d6bd3de0dcbf76f06194b52 Mon Sep 17 00:00:00 2001 From: "U-WIN-6O36QGINL6D\\abcgg" Date: Fri, 23 Jun 2023 13:51:55 +0800 Subject: [PATCH 14/14] Updated ci action --- .github/workflows/ci.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f0f618b3f..9b5277217 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,18 +31,14 @@ jobs: - name: Build app for release run: | premake5 vs2022 - msbuild build\VEngine-wks.sln -nologo -m -p:Configuration=Release /p:Platform=x64 /p:Projects="build\VEngine\VEngine.vcxproj" + msbuild build\VEngine-wks.sln -nologo -m -p:Configuration=Release -p:Platform=x64 -p:Projects="build\VEngine\VEngine.vcxproj" - name: Create artifact run: | mkdir -p temp/artifact cp bin/x64/Release/*.exe temp/artifact/ - #cp -R VEngine/Assets temp/artifact/ - cp -R VEngine/Shaders temp/artifact/ - cp D:/dev2/fbxsdk202032/lib/vs2017/x64/release/*.dll temp/artifact/ - cp D:/dev2/PhysX.4.1.229882250/bin/Release/*.dll temp/artifact/ - cp D:/dev2/qt-5.15.2/bin/*.dll temp/artifact/ - cp -R D:/dev2/qt-5.15.2/plugins temp/artifact/ + #cp -r VEngine/Assets temp/artifact/ + cp -r VEngine/Shaders temp/artifact/ - name: Upload artifact uses: actions/upload-artifact@v3