Skip to content

Commit

Permalink
Add crashRpt in CI.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarod42 committed Jan 21, 2024
1 parent e149403 commit 8a43226
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
10 changes: 9 additions & 1 deletion .github/workflows/premake5-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
24 changes: 24 additions & 0 deletions premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"}
Expand All @@ -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*" }
Expand Down Expand Up @@ -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"

Expand All @@ -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"

Expand All @@ -110,6 +129,7 @@ project "tests"

includedirs { "src", "src/lib" }
links { "maxr_lib" }
linksToCrashRpt()

project "maxr_lib"
kind "StaticLib"
Expand All @@ -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"
Expand Down

0 comments on commit 8a43226

Please sign in to comment.