/xmake-skills:xmake-toolchainsfrom xmake-skills
Switches compilers (gcc/clang/msvc/mingw), sets up cross-compilation for Android/iOS/embedded/wasm, and defines custom toolchains in xmake.
Ships in xmake-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
A toolchain bundles a compiler, linker, archiver, and related tools. You pick one per configure.
xmake show -l toolchains # list available toolchains (~77 of them)
xmake f --toolchain=clang
xmake f --toolchain=gcc-11 # gcc-12 .. gcc-16 exist as well
xmake f --toolchain=mingw --mingw=/opt/llvm-mingw
xmake f --toolchain=msvc --vs=2022
Notable ones beyond the usual gcc/clang/msvc:
| Toolchain | For |
|---|---|
zigcc | C/C++ through zig cc, a cross compiler with no sysroot — @see the xmake-zigcc skill |
zig | Zig code |
muslcc | musl-based cross toolchains, downloaded on demand |
emcc / wasi | WebAssembly (emscripten / WASI) |
cosmocc | build-once run-anywhere binaries |
dotnet | C# and the .NET SDK |
cuda | nvcc / nvc / nvc++ / nvfortran |
filc | a memory-safe C/C++ implementation |
ascendc | Huawei Ascend C (bisheng driver) |
armclang / iar / sdcc | embedded compilers |
xmake f --toolchain=clang --sdk=/opt/llvm-18 # the sdk root
xmake f --toolchain=gcc --bin=/opt/gcc/bin # only the bin directory
xmake f --toolchain=clang --cc=clang-18 --cxx=clang++-18 # individual tools
--sdk is the standard knob: xmake derives bin/, include/ and lib/ from it.
In xmake.lua:
set_toolchains("clang")
target("app")
set_toolchains("gcc-11") -- override per target
xmake f -p android --ndk=~/android-ndk-r26 -a arm64-v8a
xmake
Arch options: armeabi-v7a, arm64-v8a, x86, x86_64.
xmake f -p iphoneos -a arm64
xmake f -p macosx -a arm64 # Apple Silicon
xmake f -p mingw --mingw=/usr/x86_64-w64-mingw32 -a x86_64
xmake f -p wasm --toolchain=emcc
xmake f -p cross --sdk=/opt/my-sdk --cross=arm-linux-gnueabihf- -a arm
--sdk points to the SDK root; --cross is the tool prefix.
No sdk to download by hand — xmake fetches the toolchain itself:
xmake f -p linux -a arm64 --toolchain=muslcc
xmake f -p cross --toolchain=muslcc --cross=riscv64-linux-musl
xmake f -p linux -a arm64 --toolchain=zigcc
xmake f -p freebsd --cross=x86_64-freebsd --toolchain=zigcc
zig cc carries its own libc for every target, so there is nothing to install. @see the
xmake-zigcc skill for the tuple mapping and its gotchas.
toolchain("my-cross")
set_kind("standalone")
set_sdkdir("/opt/my-sdk")
set_toolset("cc", "arm-linux-gnueabihf-gcc")
set_toolset("cxx", "arm-linux-gnueabihf-g++")
set_toolset("ld", "arm-linux-gnueabihf-g++")
set_toolset("ar", "arm-linux-gnueabihf-ar")
set_toolset("strip", "arm-linux-gnueabihf-strip")
toolchain_end()
xmake f --toolchain=my-cross -p cross -a arm
target("firmware")
set_toolchains("my-cross")
set_plat("cross")
set_arch("arm")
if is_plat("android", "iphoneos") then ... end
if is_arch("arm64", "arm64-v8a") then ... end
if is_host("windows") then ... end -- the machine running xmake
xmake-packagesxmake-targetsWhat SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub xmake-io/xmake-skills --plugin xmake-skills58 skills in this plugin
/xmake-addon-developmentUse when writing an Xmake addon — the `addon.lua` manifest, the payload layout (plugins/rules/toolchains/modules/includes/templates), `@self` references, shipping package definitions with an addon, `add_globalmodules`, testing it locally, and publishing it to xmake-repo as an `addon` kind package./xmake-addonsUse when installing or using an Xmake addon — `xmake addon --install/--list/--remove/--upgrade/--search`, declaring `add_addons(...)` in a project, and referencing addon payloads with `@addon/<name>/<rule>`, `@addon.<name>.<module>` or `@self`. For writing and publishing one, see xmake-addon-development./xmake-async-jobsUse when running parallel / async work inside xmake scripts — `async.runjobs` for parallel job execution, `async.jobgraph` (DAG) for dependency-ordered jobs, `async.jobpool` (tree structure), `core.base.scheduler` coroutine scheduling, semaphores, and `on_build_files(..., {jobgraph = true})` in rules. For running external compile jobs faster, see `xmake-build-optimization`./xmake-basicsUse when the user is starting a new Xmake project, installing Xmake, or needs the minimal xmake.lua structure. Covers installation, `xmake create`, the project layout, and the smallest valid xmake.lua./xmake-build-cacheUse when configuring or debugging xmake's local build cache (built-in, replaces ccache) or the remote compile cache service (shared across machines via `xmake service --ccache`). Covers enabling/disabling, fallbacks to external ccache, remote cache server/client setup, and cache cleaning./xmake-build-optimizationUse when a project builds slowly and you want to make it faster — parallel jobs, unity build, precompiled headers, build cache, LTO, link-time improvements, binary package cache, and profiling with `XMAKE_PROFILE=perf:*`. Covers idiomatic xmake speedups and the order to try them.Other plugins' skills for the same job