When creating software that's intended to run on several platforms and you're planning to cross compile, it's always a good idea to include the sources of 3rd party libraries (or the libraries themself if you don't have the source code) into your projects source and build tree.
Ideally everything can be built out-of-source-tree, but sometimes (often) that's not the case, so you've to do several builds manually, copying the resulting binaries at some place your main project's build system can access them.
For cross compiling it usually boils down to exactly specify which toolchain binaries to use. For example on Linux the MinGW cross compilers usually are named something like i686-w64-mingw32-…
(or similar). When configuring the 3rd party libraries build you've to specify which ones to use. Depending on the build system this either happens through the CC
, CXX
, LD
and some other environment variables, or through the BUILD
, HOST
and TARGET
variables (see here https://stackoverflow.com/a/5139451/524368).
The best situation is, if you can integrate everything that's 3rd party into your projects build system, because that relieves you from manually managing that. Personally I've come to like the CMake build system a lot, because it supports out-of-tree builds and if you've got libraries that use CMake themself you can simply copy their source trees into a subdirectory of your project and include their CMake configuration.
Note that's it's often a valid option to replace a projects build system if the build itself is not too complicated (replacing the build system of something like the Linux kernel or ffmpeg is madness, replacing the build system of something like GLFW may be a viable option).