Skip to content

Commit a44f691

Browse files
committed
CI: Add MinGW/GCC build to Windows GHA
1 parent 68f053b commit a44f691

File tree

5 files changed

+39
-12
lines changed

5 files changed

+39
-12
lines changed

.github/workflows/windows_builds.yml

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,22 +30,32 @@ jobs:
3030
# Skip debug symbols, they're way too big with MSVC.
3131
sconsflags: debug_symbols=no vsproj=yes vsproj_gen_only=no windows_subsystem=console
3232
bin: ./bin/godot.windows.editor.x86_64.exe
33-
artifact: true
33+
compiler: msvc
3434

3535
- name: Editor w/ clang-cl (target=editor, tests=yes, use_llvm=yes)
3636
cache-name: windows-editor-clang
3737
target: editor
3838
tests: true
3939
sconsflags: debug_symbols=no windows_subsystem=console use_llvm=yes
4040
bin: ./bin/godot.windows.editor.x86_64.llvm.exe
41+
compiler: clang
4142

4243
- name: Template (target=template_release, tests=yes)
4344
cache-name: windows-template
4445
target: template_release
4546
tests: true
4647
sconsflags: debug_symbols=no
4748
bin: ./bin/godot.windows.template_release.x86_64.console.exe
48-
artifact: true
49+
compiler: msvc
50+
51+
- name: Template w/ GCC (target=template_release, tests=yes, use_mingw=yes)
52+
cache-name: windows-template-gcc
53+
# MinGW takes MUCH longer to compile; save time by only targeting Template.
54+
target: template_release
55+
tests: true
56+
sconsflags: debug_symbols=no use_mingw=yes
57+
bin: ./bin/godot.windows.template_release.x86_64.console.exe
58+
compiler: gcc
4959

5060
steps:
5161
- name: Checkout
@@ -69,16 +79,21 @@ jobs:
6979
uses: dsaltares/[email protected]
7080
with:
7181
repo: godotengine/godot-angle-static
72-
version: tags/chromium/6029
73-
file: Windows.6029-1.MSVC_17.x86_64.x86_32.zip
82+
version: tags/chromium/6601.2
83+
file: godot-angle-static-x86_64-${{ matrix.compiler == 'gcc' && 'gcc' || 'msvc' }}-release.zip
7484
target: angle/angle.zip
7585

7686
- name: Extract pre-built ANGLE static libraries
7787
run: Expand-Archive -Force angle/angle.zip ${{ github.workspace }}/
7888

7989
- name: Setup MSVC problem matcher
90+
if: matrix.compiler == 'msvc'
8091
uses: ammaraskar/msvc-problem-matcher@master
8192

93+
- name: Setup GCC problem matcher
94+
if: matrix.compiler != 'msvc'
95+
uses: ammaraskar/gcc-problem-matcher@master
96+
8297
- name: Compilation
8398
uses: ./.github/actions/godot-build
8499
with:
@@ -94,12 +109,12 @@ jobs:
94109
continue-on-error: true
95110

96111
- name: Prepare artifact
97-
if: ${{ matrix.artifact }}
112+
if: matrix.compiler == 'msvc'
98113
run: |
99114
Remove-Item bin/* -Include *.exp,*.lib,*.pdb -Force
100115
101116
- name: Upload artifact
102-
if: ${{ matrix.artifact }}
117+
if: matrix.compiler == 'msvc'
103118
uses: ./.github/actions/upload-artifact
104119
with:
105120
name: ${{ matrix.cache-name }}

drivers/d3d12/SCsub

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ from misc.utility.scons_hints import *
44
import os
55
from pathlib import Path
66

7+
import methods
8+
79
Import("env")
810

911
env_d3d12_rdd = env.Clone()
@@ -139,6 +141,10 @@ else:
139141
extra_defines += [
140142
"HAVE_STRUCT_TIMESPEC",
141143
]
144+
if methods.using_gcc(env) and methods.get_compiler_version(env)["major"] < 13:
145+
# `region` & `endregion` not recognized as valid pragmas.
146+
env_d3d12_rdd.Append(CCFLAGS=["-Wno-unknown-pragmas"])
147+
env.Append(CCFLAGS=["-Wno-unknown-pragmas"])
142148

143149
# This is needed since rendering_device_d3d12.cpp needs to include some Mesa internals.
144150
env_d3d12_rdd.Prepend(CPPPATH=mesa_private_inc_paths)

drivers/d3d12/dxil_hash.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ void compute_dxil_hash(const BYTE *pData, UINT byteCount, BYTE *pOutHash) {
9696
UINT NextEndState = bTwoRowsPadding ? N - 2 : N - 1;
9797
const BYTE *pCurrData = pData;
9898
for (UINT i = 0; i < N; i++, offset += 64, pCurrData += 64) {
99-
UINT x[16];
99+
UINT x[16] = {};
100100
const UINT *pX;
101101
if (i == NextEndState) {
102102
if (!bTwoRowsPadding && i == N - 1) {

drivers/d3d12/rendering_device_driver_d3d12.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1348,7 +1348,14 @@ RDD::TextureID RenderingDeviceDriverD3D12::texture_create(const TextureFormat &p
13481348
}
13491349
tex_info->states_ptr = &tex_info->owner_info.states;
13501350
tex_info->format = p_format.format;
1351+
#if defined(__GNUC__) && !defined(__clang__)
1352+
#pragma GCC diagnostic push
1353+
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
1354+
#endif
13511355
tex_info->desc = *(CD3DX12_RESOURCE_DESC *)&resource_desc;
1356+
#if defined(__GNUC__) && !defined(__clang__)
1357+
#pragma GCC diagnostic pop
1358+
#endif
13521359
tex_info->base_layer = 0;
13531360
tex_info->layers = resource_desc.ArraySize();
13541361
tex_info->base_mip = 0;
@@ -6578,8 +6585,6 @@ static Error create_command_signature(ID3D12Device *device, D3D12_INDIRECT_ARGUM
65786585

65796586
Error RenderingDeviceDriverD3D12::_initialize_frames(uint32_t p_frame_count) {
65806587
Error err;
6581-
D3D12MA::ALLOCATION_DESC allocation_desc = {};
6582-
allocation_desc.HeapType = D3D12_HEAP_TYPE_DEFAULT;
65836588

65846589
//CD3DX12_RESOURCE_DESC resource_desc = CD3DX12_RESOURCE_DESC::Buffer(D3D12_CONSTANT_BUFFER_DATA_PLACEMENT_ALIGNMENT);
65856590
uint32_t resource_descriptors_per_frame = GLOBAL_GET("rendering/rendering_device/d3d12/max_resource_descriptors_per_frame");

platform/windows/detect.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,7 @@ def get_ar_version(env):
662662
print_warning("Couldn't check version of `ar`.")
663663
return ret
664664

665-
match = re.search(r"GNU ar \(GNU Binutils\) (\d+)\.(\d+)(?:\.(\d+))?", output)
665+
match = re.search(r"GNU ar(?: \(GNU Binutils\)| version) (\d+)\.(\d+)(?:\.(\d+))?", output)
666666
if match:
667667
ret["major"] = int(match[1])
668668
ret["minor"] = int(match[2])
@@ -788,8 +788,9 @@ def configure_mingw(env: "SConsEnvironment"):
788788
env["CXX"] = mingw_bin_prefix + "g++"
789789
if try_cmd("as --version", env["mingw_prefix"], env["arch"]):
790790
env["AS"] = mingw_bin_prefix + "as"
791-
if try_cmd("gcc-ar --version", env["mingw_prefix"], env["arch"]):
792-
env["AR"] = mingw_bin_prefix + "gcc-ar"
791+
ar = "ar" if os.name == "nt" else "gcc-ar"
792+
if try_cmd(f"{ar} --version", env["mingw_prefix"], env["arch"]):
793+
env["AR"] = mingw_bin_prefix + ar
793794
if try_cmd("gcc-ranlib --version", env["mingw_prefix"], env["arch"]):
794795
env["RANLIB"] = mingw_bin_prefix + "gcc-ranlib"
795796

0 commit comments

Comments
 (0)