/xmake-skills:xmake-targetsfrom xmake-skills
Configures xmake build targets: sets kind (binary/static/shared), adds files/includes/links, defines dependencies, and applies per-target compile/link flags.
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 target is a unit of build output. Every buildable artifact lives inside target("name") ... target_end() (or just the indented block until the next top-level call).
target("app")
set_kind("binary") -- executable
target("mylib")
set_kind("static") -- .a / .lib
target("mydyn")
set_kind("shared") -- .so / .dll / .dylib
target("headeronly")
set_kind("headeronly") -- no compilation, just install headers
target("foo")
set_kind("static")
add_files("src/*.cpp", "src/**/*.cpp")
remove_files("src/legacy/*.cpp")
add_includedirs("include", {public = true}) -- public = also exposed to dependents
add_headerfiles("include/(**.h)") -- for `xmake install`
Globs: * matches one level, ** matches recursively. (...) in add_headerfiles preserves directory structure.
target("mylib")
set_kind("static")
add_files("src/lib/*.cpp")
add_includedirs("include", {public = true})
target("app")
set_kind("binary")
add_files("src/main.cpp")
add_deps("mylib") -- inherits public includes/defines/links
target("app")
set_languages("c++17")
set_warnings("all", "error")
set_optimize("fastest") -- none|faster|fastest|smallest
set_symbols("debug") -- debug|hidden
add_defines("MY_MACRO=1", {public = true})
add_cxflags("-Wshadow", {force = true})
add_ldflags("-Wl,--as-needed")
add_links("pthread") -- prefer add_syslinks on cross-platform code
add_syslinks("pthread", "dl")
{public = true} propagates to dependents; {force = true} skips the automatic flag-detection filter.
target("app")
if is_plat("windows") then
add_files("src/win/*.cpp")
elseif is_plat("linux", "macosx") then
add_files("src/posix/*.cpp")
end
if is_mode("debug") then
add_defines("DEBUG")
end
target("app")
after_build(function (target)
print("built: %s", target:targetfile())
end)
Hooks available: on_load, before_build, on_build, after_build, before_install, after_install, before_run, after_run, etc.
xmake-optionsxmake-packagesxmake-rulesWhat 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`.Other plugins' skills for the same job