-
-
Notifications
You must be signed in to change notification settings - Fork 492
Building with MXE (cross compile)
Ingo Ruhnke edited this page Aug 28, 2018
·
1 revision
Template:Milestone 2
M Cross Evironment (MXE) provides an easy to set up cross compiling environment which produces static windows binaries. You can use MXE to build SuperTux.
- Install MXE according to the documentation:
git clone -b stable
https://github.com/mxe/mxe.git
The location you installed it into will be called mxe_path later on.
- Install the required libraries in MXE:
make boost curl gcc gettext glew openal physfs sdl sdl_image sdl_mixer ogg vorbis w32api
- checkout a supertux copy into a directory outside the mxe tree.
- windres.exe is hardcoded in supertux. Go to /mxe_path/usr/bin and symlink i686-pc-mingw32-windres to windres.exe:
ln -s windres.exe ./i686-pc-mingw32-windres
see also Bug 846
- cd into the supertux directory and create a build directory
mkdir build
cd build
- Now launch cmake:
ccmake .. -DCMAKE_TOOLCHAIN_FILE=/
mxe_path
/usr/i686-pc-mingw32/share/cmake/mxe-conf.cmake
- Configure by pressing [c]
- You'll get an error about SDLIMAGE_INCLUDE_DIR. Exit with [e].
- Now set the following variables in “advanced mode” [t]. Use the arrow keys to move, [Return] to enter and leave editing mode.
CMAKE_CXX_FLAGS |
-DGLEW_STATIC=1 -DAL_LIBTYPE_STATIC=1 |
CMAKE_CXX_STANDARD_LIBRARIES |
-lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lcurl -lidn -lintl -lwldap32 -lgnutls -lhogweed -lgmp -lnettle -lssh2 -lgcrypt -lgpg-error -lws2_32 -lOpenAL32 -luuid -lSDL_image -lmingw32 -lSDLmain -lSDL -liconv -lm -luser32 -lgdi32 -lwinmm -ldxguid -ltiff -llzma -ljpeg -lpng15 -lz -lGLEW -lopengl32 |
SDLIMAGE_INCLUDE_DIR |
/ mxe_path /usr/i686-pc-mingw32/include/SDL
|
- Press [c] to configure again: There should be no more errors
- Press [g] to generate the makefiles and exit ccmake. Ccmake might complain about
CMAKE_TOOLCHAIN)FILE
not being used in the project: just ignore ([e]). - Now type
PATH=$PATH:/
mxe_path
/usr/bin make
and watch it compile. If you forgot thePATH
statement then cmake will complain about not findingwindres.exe
. - The resulting
supertux2.exe
does not depend on any dlls.
Home
Guidelines
Game Mechanics
Tools
Engine
- Cameras in other games
- Collision
- Configuration File
- Console
- Cutscenes
- Game_Engine
- Lighting
- Map_transformer
- Portables
- SceneGraph
- Scripting
Specifications
Milestones
- Milestone 1 Analysis
- Milestone 2 Design Document
- Milestone 2 Design Document Old
- Milestone 3 Design Document
Building (mostly outdated)
- INSTALL.md
- Building
- Building on macOS
- Building SuperTux
- Building on Windows
- Building with MXE (cross-compile)
Meetings