Skip to content

Commit 4a51190

Browse files
aitorcikiCalinou
andauthored
Update MinGW-w64 instructions for Windows cross-compilation (godotengine#8469)
Fix outdated environment variables when setting up MinGW-w64 paths. Also add a note to mind different host/target architectures (common pitfall when compiling from e.g. Apple silicon). Co-authored-by: Hugo Locurcio <[email protected]>
1 parent b9f8f9e commit 4a51190

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

contributing/development/compiling/compiling_for_windows.rst

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -221,18 +221,26 @@ the following binaries in your ``PATH`` environment variable::
221221
x86_64-w64-mingw32-gcc
222222

223223
If the binaries are not located in the ``PATH`` (e.g. ``/usr/bin``),
224-
you can define the following environment variables to give a hint to
224+
you can define the following environment variable to give a hint to
225225
the build system::
226226

227-
export MINGW32_PREFIX="/path/to/i686-w64-mingw32-"
228-
export MINGW64_PREFIX="/path/to/x86_64-w64-mingw32-"
227+
export MINGW_PREFIX="/path/to/mingw"
228+
229+
Where ``/path/to/mingw`` is the path containing the ``bin`` directory where
230+
``i686-w64-mingw32-gcc`` and ``x86_64-w64-mingw32-gcc`` are located (e.g.
231+
``/opt/mingw-w64`` if the binaries are located in ``/opt/mingw-w64/bin``).
229232

230233
To make sure you are doing things correctly, executing the following in
231234
the shell should result in a working compiler (the version output may
232235
differ based on your system)::
233236

234-
${MINGW32_PREFIX}gcc --version
235-
# i686-w64-mingw32-gcc (GCC) 6.1.0 20160427 (Mageia MinGW 6.1.0-1.mga6)
237+
${MINGW_PREFIX}/bin/x86_64-w64-mingw32-gcc --version
238+
# x86_64-w64-mingw32-gcc (GCC) 13.2.0
239+
240+
.. note:: When cross-compiling for Windows using MinGW-w64, keep in mind only
241+
``x86_64`` and ``x86_32`` architectures are supported. Be sure to
242+
specify the right ``arch=`` option when invoking SCons if building
243+
from a different architecture.
236244

237245
Troubleshooting
238246
~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)