From fb06577c237d1a9e43353e41ef6c8e4b242886c4 Mon Sep 17 00:00:00 2001 From: Valiantsin Dzerakh Date: Fri, 30 Oct 2026 20:54:28 +0300 Subject: [PATCH] Target Windows 10 in the runtime flags so llvm-mingw sees the DPI functions llvm-mingw's headers default to Windows 7 and hide AdjustWindowRectExForDpi, GetDpiForWindow and the other per-monitor DPI functions, so the release toolchain failed on gfx_window.c and dpi_probe.c. MSYS2's headers already default to Windows 10, the port's minimum. Co-Authored-By: Claude Opus 5.5 --- tools/build_game.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/build_game.py b/tools/build_game.py index 3efcfbea..990c2072 100644 --- a/tools/build_game.py +++ b/tools/build_game.py @@ -76,7 +76,9 @@ SDL3_DLLS = [UCRT / 'SDL3.dll', UCRT / 'libiconv-2.dll', UCRT / 'libopus-0.dll'] # Flags for generated code as LAS Recomp builds it (Makefile GENFLAGS, Windows), plus -march for the FP/SIMD lowering. GEN_FLAGS = ['-O1', '-fno-strict-aliasing', '-Wno-return-type', '-Wno-unused-label', '-fvisibility=hidden', '-march=x86-64-v3'] -RT_FLAGS = ['-O2', '-g', '-Wall', '-fno-strict-aliasing', '-march=x86-64-v3'] +# _WIN32_WINNT: Windows 10, the port's minimum. MSYS2's headers default to it, llvm-mingw's (the release toolchain) to +# Windows 7, which hides the per-monitor DPI functions gfx_window.c and dpi_probe.c call. +RT_FLAGS = ['-O2', '-g', '-Wall', '-fno-strict-aliasing', '-march=x86-64-v3', '-D_WIN32_WINNT=0x0A00'] # -Xlinker passes the map path as one argument; -Wl, would split it at any comma in the build dir path LINK_FLAGS = ['-fuse-ld=lld', '-Wl,--stack,16777216', '-Xlinker', '"--Map=$builddir/totk.map"'] # the map feeds tools/prof_report.py LINK_LIBS = ['-lpsapi', '-lbcrypt', '-lvulkan-1', '-luser32', '-lgdi32', '-ldwmapi', '-lwinmm', '-lSDL3', '-lopus', '-l:libvpx.a', '-l:libzstd.a', '-l:libstdc++.a', '-l:libwinpthread.a'] # Vulkan back end; libvpx static (movies); libzstd static (resolution.c)