xmake-cross-compilation
Installation
SKILL.md
Cross Compilation with Xmake
Cross compilation means producing binaries for a platform that is not the host you are running xmake on. In xmake it boils down to three choices:
- Which platform (
-p/--plat=) you are targeting. - Which toolchain (SDK + cross prefix + cc/cxx/ld/ar) does the work.
- Any extra flags (includes, libs, cflags) needed for the target.
Most of the time, -p <plat> --sdk=<root> is enough — xmake auto-detects the rest. The rest of this skill is the knobs you reach for when auto-detection is not enough.
1. Typical cross-SDK layout
Xmake auto-detects a toolchain SDK that looks like this: