[physfs] Compiling with MinGW on Linux

Sik the hedgehog sik.the.hedgehog at gmail.com
Sun Jun 14 00:51:58 EDT 2015


2015-06-13 7:05 GMT-03:00, Pauli Jokela <pauli.jokela at didstopia.com>:
> Could someone either provide me with CMake files for MinGW, or point me in
> the right direction? Compiling with MinGW under Windows is not an option, as
> this has to be done on a Linux system.

What I have right now, using the MinGW-w64 from the Ubuntu repo (using
Ubuntu 14.04 here):

HOST=i686-w64-mingw32
BUILD=x86_64-linux-gnu
PREFIX=/usr/local/cross-tools/${HOST}

mkdir winbuild
cd winbuild
cmake -DCMAKE_TOOLCHAIN_FILE=~/wincmake.cmake
-DCMAKE_INSTALL_PREFIX=${PREFIX}
-DCMAKE_SHARED_LINKER_FLAGS=-static-libgcc ..
make

Where ~/wincmake.cmake has this (although some of this may be pointless):

SET(CMAKE_SYSTEM_NAME Windows)
SET(CMAKE_C_COMPILER i686-w64-mingw32-gcc)
SET(CMAKE_CXX_COMPILER i686-w64-mingw32-g++)
SET(CMAKE_RC_COMPILER i686-w64-mingw32-windres)
SET(CMAKE_FIND_ROOT_PATH /usr/i686-w64-mingw32)
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

Replace i686 with x86_64 for 64-bit builds.


More information about the physfs mailing list