Add support for MinGW cross compiling

This commit is contained in:
2016-12-23 03:41:11 -06:00
parent 1b2f87197b
commit 666f455cfd
7 changed files with 46 additions and 6 deletions
-2
View File
@@ -39,5 +39,3 @@ find_path(GBA_INCLUDE_DIR gba.h
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GBA DEFAULT_MSG GBA_LIBRARY)
set(CMAKE_INSTALL_PREFIX ${DEVKITARM})
+18
View File
@@ -0,0 +1,18 @@
set(CMAKE_SYSTEM_NAME Windows)
set(TOOLCHAIN_PREFIX x86_64-w64-mingw32)
# cross compilers to use for C and C++
set(CMAKE_C_COMPILER /usr/bin/${TOOLCHAIN_PREFIX}-gcc)
set(CMAKE_CXX_COMPILER /usr/bin/${TOOLCHAIN_PREFIX}-g++)
set(CMAKE_RC_COMPILER /usr/bin/${TOOLCHAIN_PREFIX}-windres)
# target environment on the build host system
# set 1st to dir with the cross compiler's C/C++ headers/libs
set(CMAKE_FIND_ROOT_PATH /usr/${TOOLCHAIN_PREFIX})
# modify default behavior of FIND_XXX() commands to
# search for headers/libs in the target environment and
# search for programs in the build host environment
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)