Skip to content

Commit 41810e8

Browse files
committed
Update build scripts to save debug symbols
1 parent d66fbd5 commit 41810e8

File tree

4 files changed

+51
-27
lines changed

4 files changed

+51
-27
lines changed

.github/workflows/build.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,13 @@ jobs:
8585
uses: actions/upload-artifact@v4
8686
with:
8787
name: D3D9DrvRTX-${{env.GITHUB_SHA_SHORT}}
88-
path: Releases/${{env.GITHUB_SHA_SHORT}}/*
89-
retention-days: 30
88+
path: Releases/${{env.GITHUB_SHA_SHORT}}/*.zip
89+
retention-days: 45
9090
compression-level: 1
91+
- name: Upload Symbols Artifacts
92+
uses: actions/upload-artifact@v4
93+
with:
94+
name: D3D9DrvRTX-${{env.GITHUB_SHA_SHORT}}-symbols
95+
path: Releases/${{env.GITHUB_SHA_SHORT}}/symbols/
96+
retention-days: 30
97+
compression-level: 9

D3D9Drv.vcxproj.user

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,51 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
4-
<LocalDebuggerCommand>$(UNREAL_INSTALL_DIR)\System\$(UNREAL_EXE_NAME)</LocalDebuggerCommand>
4+
<LocalDebuggerCommand>$(OutDir)$(UNREAL_EXE_NAME)</LocalDebuggerCommand>
55
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
6-
<LocalDebuggerCommandArguments></LocalDebuggerCommandArguments>
6+
<LocalDebuggerCommandArguments>
7+
</LocalDebuggerCommandArguments>
78
</PropertyGroup>
89
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
9-
<LocalDebuggerCommand>$(UNREAL_INSTALL_DIR)\System64\$(UNREAL_EXE_NAME)</LocalDebuggerCommand>
10+
<LocalDebuggerCommand>$(OutDir)$(UNREAL_EXE_NAME)</LocalDebuggerCommand>
1011
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
11-
<LocalDebuggerCommandArguments></LocalDebuggerCommandArguments>
12+
<LocalDebuggerCommandArguments>
13+
</LocalDebuggerCommandArguments>
1214
</PropertyGroup>
1315
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='EditContinue|Win32'">
14-
<LocalDebuggerCommand>$(UNREAL_INSTALL_DIR)\System\$(UNREAL_EXE_NAME)</LocalDebuggerCommand>
16+
<LocalDebuggerCommand>$(OutDir)$(UNREAL_EXE_NAME)</LocalDebuggerCommand>
1517
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
16-
<LocalDebuggerCommandArguments></LocalDebuggerCommandArguments>
18+
<LocalDebuggerCommandArguments>
19+
</LocalDebuggerCommandArguments>
1720
</PropertyGroup>
1821
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='EditContinue|x64'">
19-
<LocalDebuggerCommand>$(UNREAL_INSTALL_DIR)\System64\$(UNREAL_EXE_NAME)</LocalDebuggerCommand>
22+
<LocalDebuggerCommand>$(OutDir)$(UNREAL_EXE_NAME)</LocalDebuggerCommand>
2023
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
21-
<LocalDebuggerCommandArguments></LocalDebuggerCommandArguments>
24+
<LocalDebuggerCommandArguments>
25+
</LocalDebuggerCommandArguments>
2226
</PropertyGroup>
2327
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
24-
<LocalDebuggerCommand>$(UNREAL_INSTALL_DIR)\System\$(UNREAL_EXE_NAME)</LocalDebuggerCommand>
28+
<LocalDebuggerCommand>$(OutDir)$(UNREAL_EXE_NAME)</LocalDebuggerCommand>
2529
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
26-
<LocalDebuggerCommandArguments></LocalDebuggerCommandArguments>
30+
<LocalDebuggerCommandArguments>
31+
</LocalDebuggerCommandArguments>
2732
</PropertyGroup>
2833
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
29-
<LocalDebuggerCommand>$(UNREAL_INSTALL_DIR)\System64\$(UNREAL_EXE_NAME)</LocalDebuggerCommand>
34+
<LocalDebuggerCommand>$(OutDir)$(UNREAL_EXE_NAME)</LocalDebuggerCommand>
3035
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
31-
<LocalDebuggerCommandArguments></LocalDebuggerCommandArguments>
36+
<LocalDebuggerCommandArguments>
37+
</LocalDebuggerCommandArguments>
3238
</PropertyGroup>
3339
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ASAN|Win32'">
34-
<LocalDebuggerCommand>$(UNREAL_INSTALL_DIR)\System\$(UNREAL_EXE_NAME)</LocalDebuggerCommand>
40+
<LocalDebuggerCommand>$(OutDir)$(UNREAL_EXE_NAME)</LocalDebuggerCommand>
3541
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
36-
<LocalDebuggerCommandArguments></LocalDebuggerCommandArguments>
42+
<LocalDebuggerCommandArguments>
43+
</LocalDebuggerCommandArguments>
3744
</PropertyGroup>
3845
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ASAN|x64'">
39-
<LocalDebuggerCommand>$(UNREAL_INSTALL_DIR)\System64\$(UNREAL_EXE_NAME)</LocalDebuggerCommand>
46+
<LocalDebuggerCommand>$(OutDir)$(UNREAL_EXE_NAME)</LocalDebuggerCommand>
4047
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
41-
<LocalDebuggerCommandArguments></LocalDebuggerCommandArguments>
48+
<LocalDebuggerCommandArguments>
49+
</LocalDebuggerCommandArguments>
4250
</PropertyGroup>
4351
</Project>

PropertySheet.props

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@
3434
<ConformanceMode>true</ConformanceMode>
3535
</ClCompile>
3636
<Link>
37-
<OutputFile>$(UNREAL_INSTALL_DIR)\System\D3D9DrvRTX.dll</OutputFile>
3837
<AdditionalDependencies>Core.lib;Engine.lib;Render.lib;winmm.lib;d3dx9.lib;%(AdditionalDependencies)</AdditionalDependencies>
3938
<GenerateMapFile>true</GenerateMapFile>
4039
<RandomizedBaseAddress>false</RandomizedBaseAddress>
41-
<ProgramDatabaseFile>.\Lib/D3D9Drv.pdb</ProgramDatabaseFile>
42-
<ImportLibrary>.\Lib/D3D9Drv.lib</ImportLibrary>
40+
<ImportLibrary>.\Lib\$(TargetName).lib</ImportLibrary>
41+
<ProgramDatabaseFile>.\Lib\$(TargetName).pdb</ProgramDatabaseFile>
42+
<MapFileName>.\Lib\$(TargetName).map</MapFileName>
4343
</Link>
4444
</ItemDefinitionGroup>
4545
<ItemGroup>

scripts/BuildAll.py

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from pathlib import Path
55
import zipfile
66
import subprocess
7+
import shutil
78

89
from termcolor import colored
910

@@ -38,9 +39,8 @@ def switch_game(game_code: str):
3839
print(f"Switching to '{colored(game_code, 'cyan')}'", flush=True)
3940
subprocess.run([f"{game_code}.bat"], shell=True, check=True)
4041

41-
def build(version: str | None = None, x64: bool = False):
42+
def build(version: str | None = None, configuration: str = "Release", x64: bool = False):
4243
solution_path = VS_PROJECT_PATH / "D3D9Drv.sln"
43-
configuration = "Release"
4444
platform = "x64" if x64 else "Win32"
4545

4646
# Build the Visual Studio solution
@@ -89,10 +89,17 @@ def zip_build(build_name: str, version_path: Path, x64: bool = False):
8989
zip_file.write(file_path, arcname=arc_path)
9090

9191
print(f"Zipped at: {zip_file_path}")
92+
93+
def copy_symbols(game_code: str, version_path: Path):
94+
symbols_path = version_path / "symbols" / game_code
95+
symbols_path.parent.mkdir(parents=True, exist_ok=True)
96+
shutil.copytree(VS_PROJECT_PATH / "Lib", symbols_path, dirs_exist_ok=True)
97+
print(f"Symbols copied to: {symbols_path}")
9298

9399
parser = argparse.ArgumentParser()
94-
parser.add_argument("--version-extra", required=False)
95-
parser.add_argument("-o", "--overwrite", action="store_true", required=False)
100+
parser.add_argument("--version-extra", required=False, help="Overrides the version number to build (used for CI and testing)")
101+
parser.add_argument("-o", "--overwrite", action="store_true", required=False, help="Continue the build even if the version directory exists, overwriting the existing one")
102+
parser.add_argument("--configuration", default="Release", required=False, help="Overrides the msvc compile config (Release, Debug)")
96103
args = parser.parse_args()
97104

98105
if args.version_extra:
@@ -121,12 +128,14 @@ def zip_build(build_name: str, version_path: Path, x64: bool = False):
121128

122129
for game_code in games_codes:
123130
switch_game(game_code)
124-
build(args.version_extra)
131+
build(args.version_extra, configuration=args.configuration)
125132
build_name = f"D3D9DrvRTX-{game_code}-{version}"
126133
zip_build(build_name, version_path)
134+
copy_symbols(game_code, version_path)
127135
print(flush=True)
128136
if game_code == "Unreal_227k_12":
129-
build(args.version_extra, x64=True)
137+
build(args.version_extra, configuration=args.configuration, x64=True)
130138
build_name = f"D3D9DrvRTX-{game_code}-x64-{version}"
131139
zip_build(build_name, version_path, x64=True)
140+
copy_symbols(f"{game_code}-x64", version_path)
132141
print(flush=True)

0 commit comments

Comments
 (0)