[physfs] Compiling with MinGW on Linux
Gerry JJ
trick at icculus.org
Sat Jun 13 17:04:16 EDT 2015
Save these lines into a file (eg. Toolchain-mingw32.cmake):
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 the names/paths with whatever's right for your distro. The above
works for 32-bit mingw-w64 on Ubuntu, replace i686 with x86_64 for
64-bit. You can also add more paths to FIND_ROOT_PATH before the closing
paren (useful if you've got a local install dir for this stuff)
Whenever you invoke cmake, tell it to use the file you just made:
ccmake -DCMAKE_TOOLCHAIN_FILE=/path/to/Toolchain-mingw32.cmake ..
Then proceed as normal. That should work in general, but in physfs' case
you'll also have to edit CMakeLists.txt and remove -Werror before you
run cmake.
-g
Den 13. juni 2015 12:05, skrev Pauli Jokela:
> I’ve tried for several days/weeks now to compile PhysFS on a Linux box,
> with MinGW, to product both 32- and 64-bit Windows builds.
>
> So far I haven’t succeeded. At all.
>
> 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.
>
> --
> Pauli Jokela, Didstopia
>
>
> _______________________________________________
> physfs mailing list
> physfs at icculus.org
> http://icculus.org/mailman/listinfo/physfs
>
More information about the physfs
mailing list