/xmake-skills:xmake-trybuildfrom xmake-skills
Builds third-party projects using CMake, Autotools, Meson, Ninja, Bazel, Make, MSBuild, Xcodebuild, or NdkBuild through xmake, inheriting xmake's cross-compilation and toolchain detection for Android, iOS, MinGW, and custom SDKs.
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.
trybuild lets xmake invoke another build system (CMake, Autotools, Meson, …) while still providing its own platform/toolchain detection, cross-compile support, and incremental-build wrappers. Use it when you need to build an upstream project that doesn't use xmake.lua, but still want xmake's cross-compilation ergonomics.
--trybuild= | Backend |
|---|---|
autotools | ./configure + make (cross-compile supported) |
cmake | cmake + generator (cross-compile supported) |
meson | meson + ninja |
ninja | direct ninja |
make | make / Makefile |
msbuild | Visual Studio MSBuild |
xcodebuild | Xcode CLI builds |
scons | SCons |
bazel | Bazel |
ndkbuild | Android NDK ndk-build |
Run plain xmake inside a project root that has a recognized file (CMakeLists.txt, configure, Makefile, meson.build, …). Xmake prompts before building:
$ cd libpng-1.6.35
$ xmake
note: CMakeLists.txt found, try building it (pass -y or --confirm=y/n/d to skip confirm)?
please input: y (y/n)
-- Configuring done
-- Generating done
...
output to /Users/ruki/Downloads/libpng-1.6.35/build/artifacts
build ok!
Add -y to skip the prompt in CI:
xmake -y
Artifacts land under build/artifacts/.
When a project ships multiple build systems (e.g. both configure and CMakeLists.txt):
xmake f --trybuild=cmake
xmake
Once set, subsequent xmake / xmake clean calls use the configured backend — no re-prompting.
Once trybuild is configured, normal xmake commands drive the upstream build:
xmake # build
xmake --rebuild # force full rebuild
xmake clean # clean objects
xmake clean --all # wipe everything (configure cache, artifacts)
xmake f -m debug # switch to debug build
xmake f -m release
Behavior is mapped onto each backend — e.g. for autotools, xmake clean --all runs make distclean.
The killer feature: xmake's cross-compilation config works for CMake/Autotools projects too.
xmake f -p android --trybuild=cmake [--ndk=/path/to/ndk]
xmake
Equivalent of setting up CMAKE_TOOLCHAIN_FILE=$NDK/build/cmake/android.toolchain.cmake + ANDROID_ABI + ANDROID_NATIVE_API_LEVEL by hand.
xmake f -p android --trybuild=autotools [--ndk=/path/to/ndk]
xmake
Equivalent of exporting CC, CXX, AR, LD, RANLIB, STRIP and passing --host=aarch64-linux-android to ./configure.
xmake f -p iphoneos --trybuild=cmake
xmake
xmake f -p iphoneos --trybuild=autotools
xmake
xmake f -p mingw --trybuild=cmake [--mingw=/opt/llvm-mingw]
xmake
xmake f -p cross --trybuild=cmake --sdk=/opt/arm-linux-gnueabihf
xmake
All the cross flags from xmake-cross-compilation work identically with --trybuild=... appended.
--tryconfigsExtra flags forwarded to the backend's config step:
# autotools: passed to ./configure
xmake f --trybuild=autotools --tryconfigs="--enable-shared=no --disable-tests"
# cmake: passed to cmake
xmake f --trybuild=cmake --tryconfigs="-DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=OFF"
# meson: passed to meson setup
xmake f --trybuild=meson --tryconfigs="-Doption=value"
Built-in xmake flags automatically propagate — no --tryconfigs needed for these:
xmake f --trybuild=cmake --cflags="-DNDEBUG" --ldflags="-lm" --includedirs=/opt/xyz/include
xmake
ndkbuild)If jni/Android.mk exists:
xmake f -p android --trybuild=ndkbuild [--ndk=...]
xmake
For gradle integration see the xmake-gradle plugin.
cd upstream-project
xmake f --trybuild=cmake --tryconfigs="-DBUILD_SHARED_LIBS=ON"
xmake
ls build/artifacts
cd libpng-1.6.40
xmake f -p android -a arm64-v8a --trybuild=cmake --ndk=~/android-ndk-r26 \
--tryconfigs="-DPNG_SHARED=ON -DPNG_STATIC=OFF"
xmake
cd autotools-thing
xmake f -p mingw --mingw=/usr/x86_64-w64-mingw32 --trybuild=autotools \
--tryconfigs="--disable-tests"
xmake
xmake f --trybuild=meson
xmake -j $(nproc)
add_requires → write a package recipe that uses import("package.tools.cmake") (or autoconf, meson) — see xmake-private-packages and xmake-repo-testing. The recipe gets proper version pinning, hash checks, and caching, which trybuild does not.cmake/autotools/meson/… — make sure the binary is installed. On failure, xmake -vD shows the missing tool.Makefile and CMakeLists.txt may auto-select the "wrong" one; use xmake f --trybuild=cmake to pin.xmake clean removes objects only. Use xmake clean --all to also wipe the backend's configure state.--trybuild='s doc for the given backend.--tryconfigs doesn't support = inside quoted values easily. Cross-shell quoting can be tricky; prefer multiple small flags.build/artifacts/, but some backends emit to their own layout. Look for the "output to ..." line in xmake output.--sdk/--ndk/--mingw/--cross) → xmake-cross-compilationxmake-private-packages / xmake-repo-testingxmake-commandsWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
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