Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
33 lines
1.5 KiB
CMake
33 lines
1.5 KiB
CMake
# MinGW-w64 cross-compilation toolchain for the Windows build of libnui_core.
|
|
#
|
|
# Status (todo 1): x86_64-w64-mingw32 is NOT installed on this build host and cannot be
|
|
# added without sudo, so the Windows cross target is DOCUMENTED-SKIPPED (see docs/build.md).
|
|
# The MSVC build on the user's Windows box is authoritative for shim/driver ABI acceptance;
|
|
# MinGW-w64 would only ever be a fast local SMOKE signal.
|
|
#
|
|
# Usage once a MinGW-w64 toolchain is available:
|
|
# cmake -S . -B build/win --toolchain cmake/mingw-w64.cmake && cmake --build build/win
|
|
#
|
|
# ---- Target architecture (scaffolded for BOTH; pick one) --------------------
|
|
# x64 (64-bit): set(NUI_WIN_ARCH x86_64) -> x86_64-w64-mingw32-{gcc,g++}
|
|
# x86 (32-bit): set(NUI_WIN_ARCH i686) -> i686-w64-mingw32-{gcc,g++}
|
|
# The SHIPPING Windows arch (DEA is likely x86/32-bit) is CONFIRMED from spike 4's
|
|
# `dumpbin /headers gamekdm.dll` bitness BEFORE todos 12/14 build the real driver/shim.
|
|
# Default here is x64 for the local smoke build; override with -DNUI_WIN_ARCH=i686.
|
|
if(NOT DEFINED NUI_WIN_ARCH)
|
|
set(NUI_WIN_ARCH x86_64)
|
|
endif()
|
|
|
|
set(CMAKE_SYSTEM_NAME Windows)
|
|
set(CMAKE_SYSTEM_PROCESSOR ${NUI_WIN_ARCH})
|
|
|
|
set(_nui_mingw_prefix ${NUI_WIN_ARCH}-w64-mingw32)
|
|
set(CMAKE_C_COMPILER ${_nui_mingw_prefix}-gcc)
|
|
set(CMAKE_CXX_COMPILER ${_nui_mingw_prefix}-g++)
|
|
set(CMAKE_RC_COMPILER ${_nui_mingw_prefix}-windres)
|
|
|
|
set(CMAKE_FIND_ROOT_PATH /usr/${_nui_mingw_prefix})
|
|
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
|
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
|
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|