Writing cross compilation build scripts make me feel like I'm constructing a log cabin from scratch, on the moon, without a suit, and no trees.

CMake toolchains are a joke. I've thrown them out entirely at this point and am writing custom detection logic for the different cross compilation combinations.

On that note, Microsoft's layout for their development kit is an absolute NIGHTMARE. Get your shit together, Microsoft.

Going to be a VERY long day.

  • 1
    I also have faced your struggle, and your description is very accurate indeed. Maintining several libs and executables across various platforms, we came up with dockerizing our cross-compilers with the goal of creating the same environment for each build, and only if-needed doing target specific steps in the CMakelists.txt based on an env-var that got set by the container

    called by a shellscript shadowing the magic of mounting source dir and ssh keys and whatnot into the container, it works with spartanic comfort.

    I really wish therer was a better tooling for C/C++ also for complex x-compile cases. I heard some people had set up nice chains using Conan, but did not try it out yet.
  • 1
    @h0ru5 any tips on cross compiling for windows in a linux container? How do you get the SDK libs and headers and whatnot? How do you get link.exe? WINE? Or do you run on e.g. appveyor or another windows-based CI?
  • 2
    the targets above are various linux-es and architectures, luckily no windows.

    It could be that Mingw64 is an option for you, there are dockerized crosscompilers for it, e.g. dockcross.

    I used appveyor with js once and it was good enough, the tricky part more that you have to write/maintain quite different CI/CD lanes for both linux and win.
Add Comment