| Re: [hatari-devel] mingw-w64 | 
[ Thread Index | 
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
] 
- To: hatari-devel@xxxxxxxxxxxxxxxxxxx
 
- Subject: Re: [hatari-devel] mingw-w64
 
- From: Christer Solskogen <christer.solskogen@xxxxxxxxx>
 
- Date: Mon, 16 Sep 2013 22:59:19 +0200
 
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed;        d=gmail.com; s=20120113;        h=mime-version:in-reply-to:references:from:date:message-id:subject:to         :content-type:content-transfer-encoding;        bh=YI0W7xYXxg8cK263AUyu4HmLjo3wR/I+yHRc7essTtQ=;        b=qr8WtxxahHXfNB1DTaTMKjWcsP/D08E3ZFdG4lPfAEomiu+FxHN8fAkn2lO0bPSptj         IhpgsdiZX7ob3sB9t8cYceKyGi2vZqEO+yH2ysxIePFvP3QEuEvyGCRxMuscotUQBaAD         zULZyMwU2qqlywF1rmVzmMvV0oS1nQ0FbOgAWMHYHRaNO2ebTOjM17exvXmbQmJz+8+N         IOx5fROHhzZypRwU+wJ71n9E6tnein3b0OKeOuxgC21XRowdtwNCrasX8HD5cvVmBzEv         z4NKAF9UDztJyeUnJ5vbdZzAqG9x4MQ60dg8/NqdyTWGmfkp89ZjSv6uAlQxuvK7RiRi         dacg==
 
On Mon, Sep 16, 2013 at 10:40 PM, Nicolas Pomarède
<npomarede@xxxxxxxxxxxx> wrote:
> You can send your files, I will try at least the 32 bit version to see if it
> works for my setup too (where I also need to force SDL path)
>
cat cmake/Toolchain-i686-w64-mingw32.cmake
# This Toolchain file is used to cross compile the windows
# version of Hatari under linux using mingw32
# use : cmake -DCMAKE_TOOLCHAIN_FILE=Toolchain-mingw32.cmake
# The name of the target operating system
SET(CMAKE_SYSTEM_NAME Windows)
# mingw32 versions of the different tools
# (change these depending on your system settings)
SET(CMAKE_C_COMPILER i686-w64-mingw32-gcc)
SET(CMAKE_CXX_COMPILER i686-w64-mingw32-g++)
SET(CMAKE_RC_COMPILER i686-w64-mingw32-windres)
# Base directory for the target environment
# We use the output from '-print-sysroot'
EXECUTE_PROCESS(
   COMMAND ${CMAKE_C_COMPILER} -print-sysroot
   OUTPUT_VARIABLE CMAKE_FIND_ROOT_PATH
   OUTPUT_STRIP_TRAILING_WHITESPACE
)
# bin/, include/, lib/ and share/ are often in "mingw/"
# You might need to adjust the path for your system
SET(CMAKE_FIND_ROOT_PATH ${CMAKE_FIND_ROOT_PATH}/i686-w64-mingw32)
# Uncomment this line with your own values if above doesn't work
#SET(CMAKE_FIND_ROOT_PATH /usr/i586-pc-mingw32/sys-root/mingw )
# FindSDL.cmake doesn't search correctly in CMAKE_FIND_ROOT_PATH
# so we force SDL_INCLUDE_DIR here
set (SDL_INCLUDE_DIR ${CMAKE_FIND_ROOT_PATH}/include/SDL)
# Adjust the default behaviour of the FIND_XXX() commands:
# search headers and libraries in the target environment, search
# programs in the 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)
 cat cmake/Toolchain-x86_64-w64-mingw32.cmake
# This Toolchain file is used to cross compile the windows
# version of Hatari under linux using mingw32
# use : cmake -DCMAKE_TOOLCHAIN_FILE=Toolchain-mingw32.cmake
# The name of the target operating system
SET(CMAKE_SYSTEM_NAME Windows)
# mingw32 versions of the different tools
# (change these depending on your system settings)
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)
# Base directory for the target environment
# We use the output from '-print-sysroot'
EXECUTE_PROCESS(
   COMMAND ${CMAKE_C_COMPILER} -print-sysroot
   OUTPUT_VARIABLE CMAKE_FIND_ROOT_PATH
   OUTPUT_STRIP_TRAILING_WHITESPACE
)
# bin/, include/, lib/ and share/ are often in "mingw/"
# You might need to adjust the path for your system
SET(CMAKE_FIND_ROOT_PATH ${CMAKE_FIND_ROOT_PATH}/x86_64-w64-mingw32)
# Uncomment this line with your own values if above doesn't work
#SET(CMAKE_FIND_ROOT_PATH /usr/i586-pc-mingw32/sys-root/mingw )
# FindSDL.cmake doesn't search correctly in CMAKE_FIND_ROOT_PATH
# so we force SDL_INCLUDE_DIR here
set (SDL_INCLUDE_DIR ${CMAKE_FIND_ROOT_PATH}/include/SDL)
# Adjust the default behaviour of the FIND_XXX() commands:
# search headers and libraries in the target environment, search
# programs in the 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)
You should only need to have the compilers ready in your path.
-- 
chs,