40
loading...
This website collects cookies to deliver better user experience
chroot
of your target environment, usually using QEMU user-mode for emulation.chroot
--target
. CMake uses various variables like CMAKE_<Language>_COMPILER
, usually specified in a CMAKE_TOOLCHAIN_FILE
. Makefiles usually uses CC
, CXX
, LD
, etc, but they are by no means reliable. And that isn't even counting all the weird custom build systems projects like OpenSSL use.CMAKE_C_COMPILER
, it will try to use that compiler. Unfortunately, this reliability comes at the expense of a little flexibility, preventing CMake from doing things like compiling parts of a project for the host architecture and then running them to assist compilation for the target architecture later.debootstrap
, you specify your target distribution and all the libraries you need, and it will build a package like in option #3 containing all your compilers and libraries. Then you just add this to your PATH
and tell your build system what compiler to use. (If this already exists please tell me.) Unfortunately, this solution is not without its flaws. Whoever maintains it would also have to maintain a compiler for every supported host system, probably 2 compilers if both GCC and Clang were supported. Then they would also have to bundle several different package management systems and convince them to all install in a specific directory without altering the external system.40