build: linux mingw cross-compile fixes (partial, stuck at DIMM.h) #5

Open
jann wants to merge 1 commits from claude/linux-mingw-crosscompile-fixes into main
Member

Kontext

Pokus dotáhnout Linux MinGW cross-compile release cycle pro m2dev-client-src. Po merge PRs #3 (biolog submit helper) a #4 (sash slot) do main se rozbila cross-compile cesta. Tohle jsou mechanické opravy co jsem aplikoval, aby se dostalo dál — build stále FAIL, ale 14 menších issues je vyřešeno. Dál potřebuje tvůj context.

Co v commitu

Viz commit message — 9 změněných souborů, plus 1 nový toolchain file. Konkrétně:

  • toolchains/linux-mingw64.cmake — cross-compile toolchain (MinGW x86_64, lld)
  • CMakeLists.txt — MSVC-only flagy gated, UNICODE global, __int64=long long pro non-MSVC, -mssse3 pro non-MSVC
  • 7 source files: #include <cstdint> / <cmath> additions, <SSTREAM><sstream>, typename pro std::vector template, backslash v include path fix

Co NENÍ v commitu

Untracked artefakty co jsem lokálně vytvořil na VPS v /home/mt2.jakubkadlec.dev/metin/repos/m2dev-client-src:

  • 60+ stdafx case-variant symlinks (stdafx.h, StdAfx.h, Stdafx.h v každé src/*/ složce)
  • 28 stdafx.cpp case-variant symlinks
  • 7 directory case symlinks: src/Eterlib, src/eterLib, src/eterlib, src/Eterbase, src/eterBase, src/eterbase, src/Gamelib, src/gamelib
  • ~15 header case-variant symlinks (stl.h, utils.h, grpdib.h, atd.)

Pokud chceš buildnout z clean checkoutu, tyhle potřebuješ buď dotáhnout do gitu, nebo napsat skript co je po checkout dogeneruje. Moje doporučení: lepší fix = rename skutečné soubory na lowercase (konsistentní s #include spellings) a přepsat includes. Ale to je refactor, ne quick fix.

Kde to selhává

src/EterLib/IME.h:7:

#include "DIMM.h"

DIMM.h je Microsoft DirectX IME header, není v extern/include/, není v mingw-w64 SDK. Potřebuje buď:

  1. Shim header (minimal declarations stub)
  2. #ifdef _MSC_VER guard kolem #include "DIMM.h" + wrapper v IME.h
  3. Vendoring Microsoft DirectX IME SDK (pravděpodobně neredistributable)

Motivace

Jan chtěl release cycle (v9) aby se do live client dostaly biolog HUD + sashes + talismany co jsem včera merged přes 12 PRs. Release cycle vyžaduje:

  1. Rebuild Metin2.exe — tohle je v háji
  2. Repack .m2p archivů s novým m2dev-client/assets/root/ + uiscript/ — zvládnu sám
  3. Manifest + sign + publish — zvládnu sám

Takže pokud dostaneš Metin2_Release.exe buildnutý, Claude dokončí zbytek release cyklu za 15 min.

Branch

claude/linux-mingw-crosscompile-fixes, commit 2fe362e. Merge / cherry-pick / ignore dle tvého uvážení.

Co-Authored-By: Claude

## Kontext Pokus dotáhnout Linux MinGW cross-compile release cycle pro m2dev-client-src. Po merge PRs #3 (biolog submit helper) a #4 (sash slot) do main se rozbila cross-compile cesta. Tohle jsou mechanické opravy co jsem aplikoval, aby se dostalo dál — **build stále FAIL**, ale 14 menších issues je vyřešeno. Dál potřebuje tvůj context. ## Co v commitu Viz commit message — 9 změněných souborů, plus 1 nový toolchain file. Konkrétně: - `toolchains/linux-mingw64.cmake` — cross-compile toolchain (MinGW x86_64, lld) - `CMakeLists.txt` — MSVC-only flagy gated, UNICODE global, `__int64=long long` pro non-MSVC, `-mssse3` pro non-MSVC - 7 source files: `#include <cstdint>` / `<cmath>` additions, `<SSTREAM>` → `<sstream>`, `typename` pro std::vector template, backslash v include path fix ## Co NENÍ v commitu Untracked artefakty co jsem lokálně vytvořil na VPS v `/home/mt2.jakubkadlec.dev/metin/repos/m2dev-client-src`: - **60+ stdafx case-variant symlinks** (stdafx.h, StdAfx.h, Stdafx.h v každé `src/*/` složce) - **28 stdafx.cpp case-variant symlinks** - **7 directory case symlinks**: `src/Eterlib`, `src/eterLib`, `src/eterlib`, `src/Eterbase`, `src/eterBase`, `src/eterbase`, `src/Gamelib`, `src/gamelib` - **~15 header case-variant symlinks** (stl.h, utils.h, grpdib.h, atd.) Pokud chceš buildnout z clean checkoutu, tyhle potřebuješ buď dotáhnout do gitu, nebo napsat skript co je po checkout dogeneruje. Moje doporučení: **lepší fix = rename skutečné soubory na lowercase (konsistentní s #include spellings)** a přepsat includes. Ale to je refactor, ne quick fix. ## Kde to selhává `src/EterLib/IME.h:7`: ```cpp #include "DIMM.h" ``` `DIMM.h` je Microsoft DirectX IME header, není v `extern/include/`, není v mingw-w64 SDK. Potřebuje buď: 1. Shim header (minimal declarations stub) 2. `#ifdef _MSC_VER` guard kolem `#include "DIMM.h"` + wrapper v `IME.h` 3. Vendoring Microsoft DirectX IME SDK (pravděpodobně neredistributable) ## Motivace Jan chtěl release cycle (v9) aby se do live client dostaly biolog HUD + sashes + talismany co jsem včera merged přes 12 PRs. Release cycle vyžaduje: 1. Rebuild `Metin2.exe` — tohle je v háji 2. Repack .m2p archivů s novým `m2dev-client/assets/root/` + `uiscript/` — zvládnu sám 3. Manifest + sign + publish — zvládnu sám Takže pokud dostaneš `Metin2_Release.exe` buildnutý, Claude dokončí zbytek release cyklu za 15 min. ## Branch `claude/linux-mingw-crosscompile-fixes`, commit `2fe362e`. Merge / cherry-pick / ignore dle tvého uvážení. Co-Authored-By: Claude
jann added 1 commit 2026-04-16 23:55:36 +02:00
Enables the Linux -> win-x64 MinGW cross-compile path that got broken
after recent merges. Still INCOMPLETE — build fails later at missing
DirectX IME headers (DIMM.h) and likely more vendor SDK compat issues.
Commit captures the mechanical fixes so Jakub can adopt/iterate.

Changes:

1. toolchains/linux-mingw64.cmake — MinGW cross-compile toolchain
   (Windows x86_64 target, mingw-w64 gcc/g++/windres, lld linker).

2. CMakeLists.txt:
   - MSVC-only flags (/MP, /Zi, /DEBUG linker flag) gated behind
     if(MSVC) — they break MinGW gcc which treats /MP as filename.
   - UNICODE / _UNICODE defined globally (was inside if(MSVC), but
     WIN32_FIND_DATA etc. need it everywhere).
   - __int64 -> long long compile definition for non-MSVC compilers
     so the Granny SDK header parses.
   - -mssse3 compile option for non-MSVC so _mm_shuffle_epi8 in
     EterLib/GrpImageTexture.cpp inlines correctly.

3. Include fixes for Linux case-sensitive filesystem and stricter
   GCC standard library:
   - Poly/StdAfx.h: backslash in include path -> forward slash.
   - EterBase/Stl.h: <SSTREAM> -> <sstream>.
   - EterBase/Utils.h: add <cmath> so cos() in templates resolves.
   - AudioLib/MaSoundInstance.h: add <cstdint> so uint8_t vector
     template argument is valid.
   - AudioLib/Type.h: add <cstdint> for uint32_t.
   - extern/include/utf8.h: add <cstdint> for uint8_t/uint16_t.
   - EffectLib/Type.h: typedef typename std::vector<...>::iterator
     (dependent-name C++11+ compliance).

Not committed (needs manual recreation per checkout, or git-tracking
them needs buy-in):
   - 60+ stdafx case-variant symlinks (stdafx.h, StdAfx.h, Stdafx.h)
   - 7 directory case symlinks (Eterlib, eterLib, eterBase, Gamelib,
     gamelib, Eterbase, eterbase)
   - header case-variant symlinks in individual dirs

Still failing at:
   - src/EterLib/IME.h:7 wanting DIMM.h (DirectX IME, not in extern/
     and not shipped with mingw-w64). Needs either a shim header, a
     #ifdef _MSC_VER guard, or vendoring the Microsoft DirectX IME SDK.

Work done over ~2h trying to get a fresh release cycle through from
Linux. Stopping here because each fix exposes another vendor/compat
issue that benefits from Jakub's context of the build history.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin claude/linux-mingw-crosscompile-fixes:claude/linux-mingw-crosscompile-fixes
git checkout claude/linux-mingw-crosscompile-fixes
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: metin-server/m2dev-client-src#5