diff --git a/Makefile.win b/Makefile.win index 8543ddc0d1..76f8532552 100644 --- a/Makefile.win +++ b/Makefile.win @@ -1,6 +1,14 @@ TARGET = retroarch.exe HAVE_SCREENSHOTS = 1 +# DEFINES below has carried -DHAVE_OVERLAY since before the object +# list moved to Makefile.common, which keys off these variables: the +# define without the variable compiled overlay callers against +# overlay objects that were never built, and screenshots without +# rpng could not encode. Set the variables so definitions and +# objects agree again. +HAVE_OVERLAY = 1 +HAVE_RPNG = 1 HAVE_AUDIOMIXER = 1 HAVE_RWAV = 1 HAVE_DINPUT = 1 @@ -95,7 +103,10 @@ OBJDIR := obj-w32 OS := Win32 OBJ := -LIBS := -lm +# imm32: win32_common.c pulls it with #pragma comment(lib), which +# MSVC honours and GNU ld silently ignores - link it explicitly or +# the IME composition calls are undefined under mingw. +LIBS := -lm -limm32 DEFINES := DEFINES += -I. -Ilibretro-common/include -DRARCH_INTERNAL -DHAVE_SCREENSHOTS -DHAVE_OVERLAY LDFLAGS := -L. -static-libgcc diff --git a/tools/mingw-audit-build.sh b/tools/mingw-audit-build.sh index f424307dbc..eb0bc5c1c7 100755 --- a/tools/mingw-audit-build.sh +++ b/tools/mingw-audit-build.sh @@ -8,10 +8,8 @@ # from older mingw-w64 (d3dkmthk.h; the unversioned d3d12 serialize # PFN; three D3D interface names mapped to IUnknown - layout is # irrelevant, only call edges are read), and imm32 is appended by -# relinking manually because Makefile.win assigns LIBS with := so no -# variable reaches the link from outside. HAVE_OVERLAY and HAVE_RPNG -# are set because Makefile.win's DEFINES already assume them while -# the object list keys off the make variables. +# (Makefile.win now links imm32 and sets HAVE_OVERLAY/HAVE_RPNG +# itself, so this script no longer compensates for either.) # Usage: tools/mingw-audit-build.sh (then:) # python3 tools/thread_read_audit.py --binary retroarch.exe \ # --objdump x86_64-w64-mingw32-objdump @@ -22,8 +20,6 @@ export CFLAGS="-I$STUBS -include $STUBS/d3d12_fixup.h \ -DID3D12InfoQueue=IUnknown -DD3D12_MAX_TEXTURE_DIMENSION_2_TO_EXP=17" MK="make -f Makefile.win HOST_PREFIX=x86_64-w64-mingw32- \ CXX=x86_64-w64-mingw32-gcc HAVE_D3D11=1 HAVE_D3D12=1 HAVE_FREETYPE=0 \ -HAVE_CG=0 HAVE_XAUDIO=0 HAVE_OVERLAY=1 HAVE_RPNG=1" -$MK -j"$(nproc)" || true # everything except the exe rule's link -$MK -n 2>/dev/null | grep "o retroarch.exe" | head -1 \ - | sed 's/$/ -limm32/' | sh +HAVE_CG=0 HAVE_XAUDIO=0" +$MK -j"$(nproc)" ls -la retroarch.exe