Skip to content

build(cmake): Add Clang MinGW-w64 cross-compilation toolchain#2469

Draft
JohnsterID wants to merge 1 commit intoTheSuperHackers:mainfrom
JohnsterID:feature/clang-mingw-toolchain
Draft

build(cmake): Add Clang MinGW-w64 cross-compilation toolchain#2469
JohnsterID wants to merge 1 commit intoTheSuperHackers:mainfrom
JohnsterID:feature/clang-mingw-toolchain

Conversation

@JohnsterID
Copy link

Pending draft after linked PR closed.

Add support for building with Clang targeting MinGW-w64 i686 (32-bit Windows). This provides an alternative to GCC for cross-compiling on Linux.

Components:

The toolchain auto-detects Clang 17-22 and uses LLD linker when available. Clang requires _INTEGRAL_MAX_BITS to be defined (GCC defines it automatically) for GameSpy SDK 64-bit type definitions.

Tested with:

  • Clang 19.1.7 (Debian)
  • Clang 22.1.1 (LLVM official release)

Usage:
cmake -DCMAKE_TOOLCHAIN_FILE=cmake/toolchains/clang-mingw-w64-i686.cmake ..

Requirements:
apt-get install clang lld mingw-w64

Add support for building with Clang targeting MinGW-w64 i686 (32-bit Windows).
This provides an alternative to GCC for cross-compiling on Linux.

Components:
- cmake/toolchains/clang-mingw-w64-i686.cmake: Clang cross-compilation toolchain
- cmake/mingw.cmake: Add _INTEGRAL_MAX_BITS=64 for Clang compatibility

The toolchain auto-detects Clang 17-22 and uses LLD linker when available.
Clang requires _INTEGRAL_MAX_BITS to be defined (GCC defines it automatically)
for GameSpy SDK 64-bit type definitions.

Tested with:
- Clang 19.1.7 (Debian)
- Clang 22.1.1 (LLVM official release)

Usage:
  cmake -DCMAKE_TOOLCHAIN_FILE=cmake/toolchains/clang-mingw-w64-i686.cmake ..

Requirements:
  apt-get install clang lld mingw-w64
@OmniBlade
Copy link

Changes to GamespySDK are merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants