Cross compiling is a method for building applications and libraries on a host machine for a different architecture than what is running on the host machine. When you build for a phone using an Android or iOS SDKs, you are cross compiling.
One easy way to do this is to use Qt for Device Creation, or Qt's Boot to Qt commercial tools. It is available for evaluation or purchase.
You do not have to build any of the tools and device system images yourself. I used Boot to Qt for my Raspberry Pi. This made set up a lot faster and easier. There are also more traditional ways of building for different devices, and they would be about the same, except for the target machine.
If you are on Windows, cross compiling can be a bit more tricky. You either install MinGW or Cygwin to build your own cross compiler, install Windows Subsystem for Linux, or install a prebuilt cross...