/debian-mingw-w64-scripts

MinGW-W64 Cross-Compile Scripts

Primary LanguagePythonMIT LicenseMIT

MinGW-W64 Cross-Compile Scripts

Cross-compile programs for Windows with MinGW-W64 and CMake from Debian GNU/Linux, similar to the ones found in AUR.

Maybe only useful for me, since MXE failed to build more than once and here one could easily use a debugger and IDE to understand what is going on. This is a fully static build, however the runtime seems to require libgcc_s_seh-1.dll and libwinpthread-1.dll.

Potentially, this could also be used to build the projects natively with MS VS++ (which is where this type of build script came from).

Currently, it supports building

  • ceres-solver
  • basic Qt6 GUIs

Usage

Create a container for systemd-nspawn (please be sure to review the scripts):

sudo sh -x debian-nspawn/*.sh

Then start the machine

sudo machinectl start debian-bullseye

and use it

machinectl shell $USER@debian-bullseye

The default is to use the current directory as staging area, e. g.

mkdir staging
( cd staging; python ~/nspawn/build-ava-ceres.py )
mkdir build-ava-ceres
( cd build-ava-ceres; x86_64-w64-mingw32-cmake ~/nspawn/ava-ceres; ninja )

If a particular build fails, you can single it out by running (ceres-solver is NAME used in mingw_scripts/ceres_solver.py):

python ~/nspawn/build-ava-ceres.py ceres-solver -c

You'll find

  • the sources in src/ceres-solver (and you can edit them and see what changes for the configuration)
  • the CMake errors in build/ceres-solver/CMakeFiles/CMakeError.log
  • packages are installed into /usr/*-w64-mingw32 and at least discovery for the cmake files works, however, some manual intervention for zlib was always necessary