Fix MinGW cross-compilation (#2883)

* Fix MinGW x64 cross-compilation

* Fix MinGW x86 cross-compilation
This commit is contained in:
QwertyChouskie 2017-07-22 17:17:31 -07:00 committed by auriamg
parent 979e1546fb
commit 0be10ce448
2 changed files with 8 additions and 2 deletions

View File

@ -9,8 +9,11 @@ SET(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc-posix)
SET(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++-posix) SET(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++-posix)
SET(CMAKE_RC_COMPILER x86_64-w64-mingw32-windres) SET(CMAKE_RC_COMPILER x86_64-w64-mingw32-windres)
# figure out folder to look in
execute_process(COMMAND sh -c "ls /usr/lib/gcc/x86_64-w64-mingw32/ | grep posix | tr -d '\n'" OUTPUT_VARIABLE MINGW_DEPS_FOLDER)
# here is the target environment located # here is the target environment located
SET(CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32 /usr/lib/gcc/x86_64-w64-mingw32/4.9-posix ${PROJECT_SOURCE_DIR}/dependencies) SET(CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32 /usr/lib/gcc/x86_64-w64-mingw32/${MINGW_DEPS_FOLDER}/ ${PROJECT_SOURCE_DIR}/dependencies)
# adjust the default behaviour of the FIND_XXX() commands: # adjust the default behaviour of the FIND_XXX() commands:
# search headers and libraries in the target environment, search # search headers and libraries in the target environment, search

View File

@ -9,8 +9,11 @@ SET(CMAKE_C_COMPILER i686-w64-mingw32-gcc-posix)
SET(CMAKE_CXX_COMPILER i686-w64-mingw32-g++-posix) SET(CMAKE_CXX_COMPILER i686-w64-mingw32-g++-posix)
SET(CMAKE_RC_COMPILER i686-w64-mingw32-windres) SET(CMAKE_RC_COMPILER i686-w64-mingw32-windres)
# figure out folder to look in
execute_process(COMMAND sh -c "ls /usr/lib/gcc/x86_64-w64-mingw32/ | grep posix | tr -d '\n'" OUTPUT_VARIABLE MINGW_DEPS_FOLDER)
# here is the target environment located # here is the target environment located
SET(CMAKE_FIND_ROOT_PATH /usr/i686-w64-mingw32 /usr/lib/gcc/i686-w64-mingw32/4.9-posix ${PROJECT_SOURCE_DIR}/dependencies) SET(CMAKE_FIND_ROOT_PATH /usr/i686-w64-mingw32 /usr/lib/gcc/i686-w64-mingw32/${MINGW_DEPS_FOLDER}/ ${PROJECT_SOURCE_DIR}/dependencies)
# adjust the default behaviour of the FIND_XXX() commands: # adjust the default behaviour of the FIND_XXX() commands:
# search headers and libraries in the target environment, search # search headers and libraries in the target environment, search