From 394f7ea4332d720d4c39548e1ffc7e4a01769340 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Thu, 23 Dec 2010 21:55:26 +0100 Subject: [PATCH] Win64Toolchain: added 32 bit compiler configuration It might be desirable to compile single modules with a 32 bit compiler. Added according CMake variables so they can be used easily. --- cmake/modules/MinGWCrossCompile.cmake | 7 +++++++ cmake/modules/Win64Toolchain.cmake | 2 ++ 2 files changed, 9 insertions(+) diff --git a/cmake/modules/MinGWCrossCompile.cmake b/cmake/modules/MinGWCrossCompile.cmake index bdc8bf33d..57d7e6909 100644 --- a/cmake/modules/MinGWCrossCompile.cmake +++ b/cmake/modules/MinGWCrossCompile.cmake @@ -13,6 +13,13 @@ SET(MINGW_TOOL_PREFIX ${MINGW_PREFIX}/bin/${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32 SET(CMAKE_C_COMPILER ${MINGW_TOOL_PREFIX}gcc) SET(CMAKE_CXX_COMPILER ${MINGW_TOOL_PREFIX}g++) +IF(WIN64) +# specify the cross compiler +SET(MINGW_TOOL_PREFIX32 ${MINGW_PREFIX32}/bin/${CMAKE_SYSTEM_PROCESSOR32}-w64-mingw32-) +SET(CMAKE_C_COMPILER32 ${MINGW_TOOL_PREFIX32}gcc) +SET(CMAKE_CXX_COMPILER32 ${MINGW_TOOL_PREFIX32}g++) +ENDIF() + # specify location of some tools SET(STRIP ${MINGW_TOOL_PREFIX}strip) SET(WINDRES ${MINGW_TOOL_PREFIX}windres) diff --git a/cmake/modules/Win64Toolchain.cmake b/cmake/modules/Win64Toolchain.cmake index 306bb6a4b..09c0c35ef 100644 --- a/cmake/modules/Win64Toolchain.cmake +++ b/cmake/modules/Win64Toolchain.cmake @@ -1,6 +1,8 @@ SET(MINGW_PREFIX /opt/mingw64) +SET(MINGW_PREFIX32 /opt/mingw32) SET(CMAKE_SYSTEM_PROCESSOR x86_64) +SET(CMAKE_SYSTEM_PROCESSOR32 i686) SET(WIN64 TRUE)