Skip to content

Commit 750f2ed

Browse files
authored
update windows build matrix (#2781)
* add x64, support no dxsdk * fix entrypoint
1 parent 9648089 commit 750f2ed

4 files changed

Lines changed: 85 additions & 28 deletions

File tree

.github/workflows/build.yml

Lines changed: 46 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,41 @@ jobs:
1111
strategy:
1212
fail-fast: false
1313
matrix:
14-
os: [windows-2019, windows-2022]
15-
audiolib: [miniaudio, irrklang]
14+
name:
15+
- windows
16+
- windows-xp
17+
- windows-irrklang
18+
- windows-no-dxsdk
19+
- windows-x64
20+
# - windows-2025
21+
include:
22+
- name: windows
23+
os: windows-2022
24+
vs: vs2022
25+
audiolib: miniaudio
26+
- name: windows-xp
27+
os: windows-2019
28+
vs: vs2019
29+
audiolib: miniaudio
30+
xp: true
31+
- name: windows-irrklang
32+
os: windows-2022
33+
vs: vs2022
34+
audiolib: irrklang
35+
- name: windows-no-dxsdk
36+
os: windows-2022
37+
vs: vs2022
38+
audiolib: miniaudio
39+
nodxsdk: true
40+
- name: windows-x64
41+
os: windows-2022
42+
vs: vs2022
43+
audiolib: miniaudio
44+
x64: true
45+
# - name: windows-2025
46+
# os: windows-2025
47+
# vs: vs2022
48+
# audiolib: miniaudio
1649

1750
runs-on: ${{ matrix.os }}
1851

@@ -38,7 +71,7 @@ jobs:
3871
id: premake
3972
uses: mercury233/action-cache-download-file@v1.0.0
4073
with:
41-
url: https://github.com/premake/premake-core/releases/download/v5.0.0-beta5/premake-5.0.0-beta5-windows.zip
74+
url: https://github.com/premake/premake-core/releases/download/v5.0.0-beta6/premake-5.0.0-beta6-windows.zip
4275
filename: premake5.zip
4376

4477
- name: Extract premake
@@ -168,25 +201,27 @@ jobs:
168201
git clone --depth=1 https://github.com/mercury233/irrlicht
169202
170203
- name: Check DirectX SDK
204+
if: matrix.nodxsdk != true
171205
id: dxsdk
172206
uses: actions/cache@v4
173207
with:
174208
key: dxsdk
175209
path: DXSDK
176210

177211
- name: Download DirectX SDK
178-
if: steps.dxsdk.outputs.cache-hit != 'true'
212+
if: matrix.nodxsdk != true && steps.dxsdk.outputs.cache-hit != 'true'
179213
id: dxsdk-download
180214
uses: mercury233/action-cache-download-file@v1.0.0
181215
with:
182216
url: https://download.microsoft.com/download/a/e/7/ae743f1f-632b-4809-87a9-aa1bb3458e31/DXSDK_Jun10.exe
183217

184218
- name: Install DirectX SDK
185-
if: steps.dxsdk.outputs.cache-hit != 'true'
219+
if: matrix.nodxsdk != true && steps.dxsdk.outputs.cache-hit != 'true'
186220
run: |
187221
7z x ${{ steps.dxsdk-download.outputs.filepath }} -aoa
188222
189223
- name: Set DirectX SDK environment variable
224+
if: matrix.nodxsdk != true
190225
run: |
191226
$dxsdkPath = Resolve-Path 'DXSDK'
192227
"DXSDK_DIR=$($dxsdkPath.ProviderPath)\" | Out-File -FilePath $env:GITHUB_ENV -Append
@@ -196,39 +231,24 @@ jobs:
196231
xcopy /E premake\* .
197232
xcopy /E resource\* .
198233
199-
- name: Use premake to generate Visual Studio solution (2019, miniaudio)
200-
if: matrix.os == 'windows-2019' && matrix.audiolib == 'miniaudio'
234+
- name: Use premake to generate Visual Studio solution
201235
run: |
202-
.\premake5.exe vs2019 --winxp-support
203-
204-
- name: Use premake to generate Visual Studio solution (2022, miniaudio)
205-
if: matrix.os == 'windows-2022' && matrix.audiolib == 'miniaudio'
206-
run: |
207-
.\premake5.exe vs2022
208-
209-
- name: Use premake to generate Visual Studio solution (2019, irrKlang)
210-
if: matrix.os == 'windows-2019' && matrix.audiolib == 'irrklang'
211-
run: |
212-
.\premake5.exe vs2019 --winxp-support --audio-lib=irrklang
213-
214-
- name: Use premake to generate Visual Studio solution (2022, irrKlang)
215-
if: matrix.os == 'windows-2022' && matrix.audiolib == 'irrklang'
216-
run: |
217-
.\premake5.exe vs2022 --audio-lib=irrklang
236+
.\premake5.exe ${{ matrix.vs }} --audio-lib=${{ matrix.audiolib }} ${{ matrix.xp && '--winxp-support' || '' }}
218237
219238
- name: Add msbuild to PATH
220239
uses: microsoft/setup-msbuild@v2
221240

222241
- name: Build solution
223242
run: |
224-
MSBuild.exe build\YGOPro.sln /m /p:Configuration=Release
243+
MSBuild.exe build\YGOPro.sln /m /p:Configuration=Release /p:Platform=${{ matrix.x64 && 'x64' || 'Win32' }}
225244
226245
- name: Upload build artifacts
227246
uses: actions/upload-artifact@v4
228247
with:
229-
name: YGOPro-${{ matrix.os }}-${{ matrix.audiolib }}
248+
name: YGOPro-${{ matrix.name }}
230249
path: |
231-
bin/release/YGOPro.exe
250+
bin/release/x86/YGOPro.exe
251+
bin/release/x64/YGOPro.exe
232252
233253
build-linux:
234254
strategy:

gframe/premake5.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ project "YGOPro"
6868
end
6969

7070
filter "system:windows"
71+
entrypoint "mainCRTStartup"
7172
defines { "_IRR_WCHAR_FILESYSTEM" }
7273
files "ygopro.rc"
7374
links { "opengl32", "ws2_32", "winmm", "gdi32", "kernel32", "user32", "imm32" }

premake/irrlicht/premake5.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,11 @@ project "irrlicht"
155155

156156
filter { "system:windows" }
157157
defines { "_IRR_WCHAR_FILESYSTEM" }
158-
includedirs { "$(DXSDK_DIR)Include" }
158+
if USE_DXSDK then
159+
includedirs { "$(DXSDK_DIR)Include" }
160+
else
161+
defines { "NO_IRR_COMPILE_WITH_DIRECT3D_9_" }
162+
end
159163

160164
filter { "system:linux" }
161165
links { "X11", "Xxf86vm" }

premake5.lua

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,13 @@ BUILD_LUA = true
1010
LUA_LIB_NAME = "lua" -- change this if you don't build Lua
1111

1212
BUILD_EVENT = os.istarget("windows")
13+
1314
BUILD_FREETYPE = os.istarget("windows")
15+
1416
BUILD_SQLITE = os.istarget("windows")
1517

1618
BUILD_IRRLICHT = true -- modified Irrlicht is required, can't use the official one
19+
USE_DXSDK = true
1720

1821
USE_AUDIO = true
1922
AUDIO_LIB = "miniaudio" -- can be "miniaudio" or "irrklang"
@@ -51,6 +54,7 @@ newoption { trigger = "build-irrlicht", category = "YGOPro - irrlicht", descript
5154
newoption { trigger = "no-build-irrlicht", category = "YGOPro - irrlicht", description = "" }
5255
newoption { trigger = "irrlicht-include-dir", category = "YGOPro - irrlicht", description = "", value = "PATH" }
5356
newoption { trigger = "irrlicht-lib-dir", category = "YGOPro - irrlicht", description = "", value = "PATH" }
57+
newoption { trigger = "no-dxsdk", category = "YGOPro - irrlicht", description = "" }
5458

5559
newoption { trigger = "no-audio", category = "YGOPro", description = "" }
5660
newoption { trigger = "audio-lib", category = "YGOPro", description = "", value = "miniaudio, irrklang", default = AUDIO_LIB }
@@ -148,6 +152,16 @@ if not BUILD_IRRLICHT then
148152
IRRLICHT_LIB_DIR = GetParam("irrlicht-lib-dir") or os.findlib("irrlicht")
149153
end
150154

155+
if GetParam("no-dxsdk") then
156+
USE_DXSDK = false
157+
end
158+
if USE_DXSDK and os.istarget("windows") then
159+
if not os.getenv("DXSDK_DIR") then
160+
print("DXSDK_DIR environment variable not set, it seems you don't have the DirectX SDK installed. DirectX mode will be disabled.")
161+
USE_DXSDK = false
162+
end
163+
end
164+
151165
if GetParam("no-audio") then
152166
USE_AUDIO = false
153167
elseif GetParam("no-use-miniaudio") then
@@ -252,7 +266,6 @@ workspace "YGOPro"
252266
configurations { "Release", "Debug" }
253267

254268
filter "system:windows"
255-
entrypoint "mainCRTStartup"
256269
systemversion "latest"
257270
startproject "YGOPro"
258271
if WINXP_SUPPORT then
@@ -261,6 +274,13 @@ workspace "YGOPro"
261274
else
262275
defines { "WINVER=0x0601" } -- WIN7
263276
end
277+
platforms { "Win32", "x64" }
278+
279+
filter { "system:windows", "platforms:Win32" }
280+
architecture "x86"
281+
282+
filter { "system:windows", "platforms:x64" }
283+
architecture "x86_64"
264284

265285
filter "system:macosx"
266286
libdirs { "/usr/local/lib" }
@@ -287,6 +307,18 @@ workspace "YGOPro"
287307
defines "_DEBUG"
288308
targetdir "bin/debug"
289309

310+
filter { "system:windows", "platforms:Win32", "configurations:Release" }
311+
targetdir "bin/release/x86"
312+
313+
filter { "system:windows", "platforms:Win32", "configurations:Debug" }
314+
targetdir "bin/debug/x86"
315+
316+
filter { "system:windows", "platforms:x64", "configurations:Release" }
317+
targetdir "bin/release/x64"
318+
319+
filter { "system:windows", "platforms:x64", "configurations:Debug" }
320+
targetdir "bin/debug/x64"
321+
290322
filter { "configurations:Release", "action:vs*" }
291323
if linktimeoptimization then
292324
linktimeoptimization "On"

0 commit comments

Comments
 (0)