From 8a4322684bb24b575e96d84423d1f5e4bd748021 Mon Sep 17 00:00:00 2001 From: Jarod42 Date: Tue, 16 Jan 2024 18:06:20 +0100 Subject: [PATCH] Add crashRpt in CI. --- .github/workflows/premake5-windows.yml | 10 +++++++++- premake5.lua | 24 ++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/.github/workflows/premake5-windows.yml b/.github/workflows/premake5-windows.yml index c3124dbf..7bbf168c 100644 --- a/.github/workflows/premake5-windows.yml +++ b/.github/workflows/premake5-windows.yml @@ -37,8 +37,16 @@ jobs: cmd.exe /c "call ""$vcvarall_path"" x86_amd64 && cd premake-build && nmake -f Bootstrap.mak MSDEV=vs2022 windows-msbuild PLATFORM=Win32 CONFIG=release" cp premake-build/bin/release/premake5.exe ./ + - name: Retrieve CrashRpt_v.1.4.3_r1645 + run: | + curl -o CrashRpt_v.1.4.3_r1645.7z https://kumisystems.dl.sourceforge.net/project/crashrpt/CrashRpt_v.1.4.3_r1645.7z + 7z x CrashRpt_v.1.4.3_r1645.7z -oCrashRpt_v.1.4.3_r1645 + cp CrashRpt_v.1.4.3_r1645/bin/CrashRpt1403.dll data/ + cp CrashRpt_v.1.4.3_r1645/bin/CrashSender1403.exe data/ + cp CrashRpt_v.1.4.3_r1645/lang_files/*.ini data/CrashRpt/ + - name: run premake5 - run: ./premake5.exe vs2022 --to=solution/vs2022/maxr + run: ./premake5.exe vs2022 --to=solution/vs2022/maxr --crashRpt_root=CrashRpt_v.1.4.3_r1645 - name: build run: | diff --git a/premake5.lua b/premake5.lua index 41fe8f7d..6527f0a9 100644 --- a/premake5.lua +++ b/premake5.lua @@ -5,6 +5,12 @@ newoption { default = "solution/%{_ACTION}/maxr" } +newoption { + trigger = "crashRpt_root", + value = "path", + description = "Set the location of crashRpt_root", +} + if (_ACTION == nil) then return end @@ -18,6 +24,13 @@ local nugetPackages = { -- "CrashRpt2.CPP:1.5.3", "CrashRpt2.CPP.redist:1.5.3", } +local function linksToCrashRpt() + if _OPTIONS["crashRpt_root"] ~= nil then + libdirs { path.join(_OPTIONS["crashRpt_root"], "lib") } + links { "CrashRpt1403" } + end +end + workspace "Maxr" location(locationDir) configurations {"Debug", "Release"} @@ -30,6 +43,10 @@ workspace "Maxr" externalwarnings "Off" +if _OPTIONS["crashRpt_root"] ~= nil then + defines { "USE_CRASH_RPT" } +end + filter { "action:vs*" } nuget(nugetPackages) filter { "toolset:msc*" } @@ -76,6 +93,7 @@ project "maxr" files { "src/ui/**.cpp", "src/ui/**.h", "src/maxr.rc" } includedirs { "src", "src/lib" } links { "maxr_lib", "SDL_flic", "mveplayer" } + linksToCrashRpt() debugdir "data" @@ -94,6 +112,7 @@ project "dedicated_server" files { "src/dedicatedserver/**.cpp", "src/dedicated_server/**.h", "src/maxr.rc" } includedirs { "src", "src/lib" } links { "maxr_lib", "SDL_flic", "mveplayer" } + linksToCrashRpt() debugdir "data" @@ -110,6 +129,7 @@ project "tests" includedirs { "src", "src/lib" } links { "maxr_lib" } + linksToCrashRpt() project "maxr_lib" kind "StaticLib" @@ -124,6 +144,10 @@ project "maxr_lib" includedirs { "src", "src/lib" } externalincludedirs { "src/3rd/spiritless_po/include" } +if _OPTIONS["crashRpt_root"] ~= nil then + externalincludedirs { path.join(_OPTIONS["crashRpt_root"], "include") } +end + group "3rd" project "mveplayer" kind "StaticLib"