Cross-compilation builds executable software on one system for a different CPU architecture or operating system. Zig treats it as a core compiler feature, letting an existing C++ project target more environments without changing its source code. section 4.2.1 section 4.5.1
Use the host–target pattern to reason about the setup:
- Develop on an x86-64 machine while producing binaries for Arm-based cloud machines. section 4.5.1
- Reuse the existing project rather than rewriting its source for every target environment. section 4.2.1
- Treat smooth local compilation as useful, but test the resulting program on its intended architecture and operating system. section 4.5.1

