mirror of
https://github.com/gbdev/rgbds.git
synced 2026-05-08 19:09:36 +00:00
a802bcb320
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.
23 lines
850 B
CMake
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")
|