Files
rgbds/cmake/toolchain-mingw64.cmake
T
ISSOtm a802bcb320 Switch MinGW building to CMake
Automatically grabs and compiles libpng, and avoids having hacky lines in our Makefile
(the compiler specification *should* be orthogonal to the build target!)

Also move the MinGW package install to the `install_deps.sh` script,
to move logic off of the YAML.
2026-04-16 00:57:33 +02:00

23 lines
850 B
CMake

# From https://www.mingw-w64.org/build-systems/cmake/
set(CMAKE_SYSTEM_NAME Windows)
set(CMAKE_SYSTEM_PROCESSOR x86_64)
# Specify the cross-compiler.
set(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc)
set(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++)
set(CMAKE_RC_COMPILER x86_64-w64-mingw32-windres)
# Specify the target environment.
set(CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32)
# Search for programs in the build host directories.
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# Search for libraries and headers in the target directories.
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
# CMake determines how to examine dependencies based on the *host* system, leading to
# a "file unknown error" unless the target platform is explicitly specified.
set(CMAKE_GET_RUNTIME_DEPENDENCIES_PLATFORM "windows+pe")