diff options
| author | 2018-08-31 20:08:03 +0200 | |
|---|---|---|
| committer | 2018-09-19 14:22:14 -0400 | |
| commit | a8f54f96fc0b91dee8a0ea6daf9dfd55b46a9178 (patch) | |
| tree | 92c57ae3f11b1f9ad5c7cdd76956c38b77984d44 /CMakeModules | |
| parent | Merge pull request #1196 from FearlessTobi/ccache-consistency (diff) | |
| download | yuzu-a8f54f96fc0b91dee8a0ea6daf9dfd55b46a9178.tar.gz yuzu-a8f54f96fc0b91dee8a0ea6daf9dfd55b46a9178.tar.xz yuzu-a8f54f96fc0b91dee8a0ea6daf9dfd55b46a9178.zip | |
travis: running mingw build on travis ci
This commit also fixed a broken cmake dependency with unicorn
Diffstat (limited to 'CMakeModules')
| -rw-r--r-- | CMakeModules/MinGWCross.cmake | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/CMakeModules/MinGWCross.cmake b/CMakeModules/MinGWCross.cmake new file mode 100644 index 000000000..25750f521 --- /dev/null +++ b/CMakeModules/MinGWCross.cmake | |||
| @@ -0,0 +1,54 @@ | |||
| 1 | SET(MINGW_PREFIX /usr/x86_64-w64-mingw32/) | ||
| 2 | SET(CMAKE_SYSTEM_NAME Windows) | ||
| 3 | SET(CMAKE_SYSTEM_PROCESSOR x86_64) | ||
| 4 | # Actually a hack, w/o this will cause some strange errors | ||
| 5 | SET(CMAKE_HOST_WIN32 TRUE) | ||
| 6 | |||
| 7 | |||
| 8 | SET(CMAKE_FIND_ROOT_PATH ${MINGW_PREFIX}) | ||
| 9 | SET(SDL2_PATH ${MINGW_PREFIX}) | ||
| 10 | SET(MINGW_TOOL_PREFIX ${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32-) | ||
| 11 | |||
| 12 | # Specify the cross compiler | ||
| 13 | SET(CMAKE_C_COMPILER ${MINGW_TOOL_PREFIX}gcc-posix) | ||
| 14 | SET(CMAKE_CXX_COMPILER ${MINGW_TOOL_PREFIX}g++-posix) | ||
| 15 | SET(CMAKE_RC_COMPILER ${MINGW_TOOL_PREFIX}windres) | ||
| 16 | |||
| 17 | # Mingw tools | ||
| 18 | SET(STRIP ${MINGW_TOOL_PREFIX}strip) | ||
| 19 | SET(WINDRES ${MINGW_TOOL_PREFIX}windres) | ||
| 20 | SET(ENV{PKG_CONFIG} ${MINGW_TOOL_PREFIX}pkg-config) | ||
| 21 | |||
| 22 | # ccache wrapper | ||
| 23 | OPTION(USE_CCACHE "Use ccache for compilation" OFF) | ||
| 24 | IF(USE_CCACHE) | ||
| 25 | FIND_PROGRAM(CCACHE ccache) | ||
| 26 | IF (CCACHE) | ||
| 27 | MESSAGE(STATUS "Using ccache found in PATH") | ||
| 28 | SET_PROPERTY(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ${CCACHE}) | ||
| 29 | SET_PROPERTY(GLOBAL PROPERTY RULE_LAUNCH_LINK ${CCACHE}) | ||
| 30 | ELSE(CCACHE) | ||
| 31 | MESSAGE(WARNING "USE_CCACHE enabled, but no ccache found") | ||
| 32 | ENDIF(CCACHE) | ||
| 33 | ENDIF(USE_CCACHE) | ||
| 34 | |||
| 35 | # Search for programs in the build host directories | ||
| 36 | SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) | ||
| 37 | |||
| 38 | |||
| 39 | # Echo modified cmake vars to screen for debugging purposes | ||
| 40 | IF(NOT DEFINED ENV{MINGW_DEBUG_INFO}) | ||
| 41 | MESSAGE("") | ||
| 42 | MESSAGE("Custom cmake vars: (blank = system default)") | ||
| 43 | MESSAGE("-----------------------------------------") | ||
| 44 | MESSAGE("* CMAKE_C_COMPILER : ${CMAKE_C_COMPILER}") | ||
| 45 | MESSAGE("* CMAKE_CXX_COMPILER : ${CMAKE_CXX_COMPILER}") | ||
| 46 | MESSAGE("* CMAKE_RC_COMPILER : ${CMAKE_RC_COMPILER}") | ||
| 47 | MESSAGE("* WINDRES : ${WINDRES}") | ||
| 48 | MESSAGE("* ENV{PKG_CONFIG} : $ENV{PKG_CONFIG}") | ||
| 49 | MESSAGE("* STRIP : ${STRIP}") | ||
| 50 | MESSAGE("* USE_CCACHE : ${USE_CCACHE}") | ||
| 51 | MESSAGE("") | ||
| 52 | # So that the debug info only appears once | ||
| 53 | SET(ENV{MINGW_DEBUG_INFO} SHOWN) | ||
| 54 | ENDIF() | ||