Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 46 additions & 26 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,41 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [windows-2019, windows-2022]
audiolib: [miniaudio, irrklang]
name:
- windows
- windows-xp
- windows-irrklang
- windows-no-dxsdk
- windows-x64
# - windows-2025
include:
- name: windows
os: windows-2022
vs: vs2022
audiolib: miniaudio
- name: windows-xp
os: windows-2019
vs: vs2019
audiolib: miniaudio
xp: true
- name: windows-irrklang
os: windows-2022
vs: vs2022
audiolib: irrklang
- name: windows-no-dxsdk
os: windows-2022
vs: vs2022
audiolib: miniaudio
nodxsdk: true
- name: windows-x64
os: windows-2022
vs: vs2022
audiolib: miniaudio
x64: true
# - name: windows-2025
# os: windows-2025
# vs: vs2022
# audiolib: miniaudio

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

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

- name: Extract premake
Expand Down Expand Up @@ -168,25 +201,27 @@ jobs:
git clone --depth=1 https://github.com/mercury233/irrlicht

- name: Check DirectX SDK
if: matrix.nodxsdk != true
id: dxsdk
uses: actions/cache@v4
with:
key: dxsdk
path: DXSDK

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

- name: Install DirectX SDK
if: steps.dxsdk.outputs.cache-hit != 'true'
if: matrix.nodxsdk != true && steps.dxsdk.outputs.cache-hit != 'true'
run: |
7z x ${{ steps.dxsdk-download.outputs.filepath }} -aoa

- name: Set DirectX SDK environment variable
if: matrix.nodxsdk != true
run: |
$dxsdkPath = Resolve-Path 'DXSDK'
"DXSDK_DIR=$($dxsdkPath.ProviderPath)\" | Out-File -FilePath $env:GITHUB_ENV -Append
Expand All @@ -196,39 +231,24 @@ jobs:
xcopy /E premake\* .
xcopy /E resource\* .

- name: Use premake to generate Visual Studio solution (2019, miniaudio)
if: matrix.os == 'windows-2019' && matrix.audiolib == 'miniaudio'
- name: Use premake to generate Visual Studio solution
run: |
.\premake5.exe vs2019 --winxp-support

- name: Use premake to generate Visual Studio solution (2022, miniaudio)
if: matrix.os == 'windows-2022' && matrix.audiolib == 'miniaudio'
run: |
.\premake5.exe vs2022

- name: Use premake to generate Visual Studio solution (2019, irrKlang)
if: matrix.os == 'windows-2019' && matrix.audiolib == 'irrklang'
run: |
.\premake5.exe vs2019 --winxp-support --audio-lib=irrklang

- name: Use premake to generate Visual Studio solution (2022, irrKlang)
if: matrix.os == 'windows-2022' && matrix.audiolib == 'irrklang'
run: |
.\premake5.exe vs2022 --audio-lib=irrklang
.\premake5.exe ${{ matrix.vs }} --audio-lib=${{ matrix.audiolib }} ${{ matrix.xp && '--winxp-support' || '' }}
Comment thread
mercury233 marked this conversation as resolved.

- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2

- name: Build solution
run: |
MSBuild.exe build\YGOPro.sln /m /p:Configuration=Release
MSBuild.exe build\YGOPro.sln /m /p:Configuration=Release /p:Platform=${{ matrix.x64 && 'x64' || 'Win32' }}

- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: YGOPro-${{ matrix.os }}-${{ matrix.audiolib }}
name: YGOPro-${{ matrix.name }}
path: |
bin/release/YGOPro.exe
bin/release/x86/YGOPro.exe
bin/release/x64/YGOPro.exe

build-linux:
strategy:
Expand Down
1 change: 1 addition & 0 deletions gframe/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ project "YGOPro"
end

filter "system:windows"
entrypoint "mainCRTStartup"
defines { "_IRR_WCHAR_FILESYSTEM" }
files "ygopro.rc"
links { "opengl32", "ws2_32", "winmm", "gdi32", "kernel32", "user32", "imm32" }
Expand Down
6 changes: 5 additions & 1 deletion premake/irrlicht/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,11 @@ project "irrlicht"

filter { "system:windows" }
defines { "_IRR_WCHAR_FILESYSTEM" }
includedirs { "$(DXSDK_DIR)Include" }
if USE_DXSDK then
includedirs { "$(DXSDK_DIR)Include" }
else
defines { "NO_IRR_COMPILE_WITH_DIRECT3D_9_" }
end

filter { "system:linux" }
links { "X11", "Xxf86vm" }
Expand Down
34 changes: 33 additions & 1 deletion premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@ BUILD_LUA = true
LUA_LIB_NAME = "lua" -- change this if you don't build Lua

BUILD_EVENT = os.istarget("windows")

BUILD_FREETYPE = os.istarget("windows")

BUILD_SQLITE = os.istarget("windows")

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

USE_AUDIO = true
AUDIO_LIB = "miniaudio" -- can be "miniaudio" or "irrklang"
Expand Down Expand Up @@ -51,6 +54,7 @@ newoption { trigger = "build-irrlicht", category = "YGOPro - irrlicht", descript
newoption { trigger = "no-build-irrlicht", category = "YGOPro - irrlicht", description = "" }
newoption { trigger = "irrlicht-include-dir", category = "YGOPro - irrlicht", description = "", value = "PATH" }
newoption { trigger = "irrlicht-lib-dir", category = "YGOPro - irrlicht", description = "", value = "PATH" }
newoption { trigger = "no-dxsdk", category = "YGOPro - irrlicht", description = "" }
Comment thread
mercury233 marked this conversation as resolved.

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

if GetParam("no-dxsdk") then
USE_DXSDK = false
end
if USE_DXSDK and os.istarget("windows") then
if not os.getenv("DXSDK_DIR") then
print("DXSDK_DIR environment variable not set, it seems you don't have the DirectX SDK installed. DirectX mode will be disabled.")
USE_DXSDK = false
end
end

if GetParam("no-audio") then
USE_AUDIO = false
elseif GetParam("no-use-miniaudio") then
Expand Down Expand Up @@ -252,7 +266,6 @@ workspace "YGOPro"
configurations { "Release", "Debug" }

filter "system:windows"
entrypoint "mainCRTStartup"
systemversion "latest"
startproject "YGOPro"
if WINXP_SUPPORT then
Expand All @@ -261,6 +274,13 @@ workspace "YGOPro"
else
defines { "WINVER=0x0601" } -- WIN7
end
platforms { "Win32", "x64" }

filter { "system:windows", "platforms:Win32" }
architecture "x86"

filter { "system:windows", "platforms:x64" }
architecture "x86_64"

filter "system:macosx"
libdirs { "/usr/local/lib" }
Expand All @@ -287,6 +307,18 @@ workspace "YGOPro"
defines "_DEBUG"
targetdir "bin/debug"

filter { "system:windows", "platforms:Win32", "configurations:Release" }
targetdir "bin/release/x86"

filter { "system:windows", "platforms:Win32", "configurations:Debug" }
targetdir "bin/debug/x86"

filter { "system:windows", "platforms:x64", "configurations:Release" }
targetdir "bin/release/x64"

filter { "system:windows", "platforms:x64", "configurations:Debug" }
targetdir "bin/debug/x64"

filter { "configurations:Release", "action:vs*" }
if linktimeoptimization then
linktimeoptimization "On"
Expand Down
Loading