/xmake-skills:xmake-swiftfrom xmake-skills
Builds Swift projects with xmake — binary/library targets, Swift ↔ C++/Objective-C interop, module name configuration, and iOS/macOS builds.
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.
Xmake builds Swift through swiftc and integrates with Xcode on Apple platforms. Use it when you want the same xmake.lua to drive a project that mixes Swift with C/C++/Objective-C.
xmake create -l swift -t console hello
cd hello
xmake run
add_rules("mode.debug", "mode.release")
target("hello")
set_kind("binary")
add_files("src/*.swift")
target("app") set_kind("binary")
target("mylib") set_kind("static")
target("mydyn") set_kind("shared")
Xmake supports automatic Swift-interop C++ header generation through the swift.interop target value.
target("myswift")
set_kind("static")
add_files("src/*.swift")
set_values("swift.interop", "cxx") -- or "objc"
set_values("swift.modulename", "MySwift") -- C++ namespace name
target("app")
set_kind("binary")
add_files("src/main.cpp")
add_deps("myswift")
set_languages("c++17")
Xmake generates a C++ header with #include "MySwift-Swift.h" style, exposing Swift types under MySwift:: namespace.
"objc" — Objective-C interop (classic, works since early Swift)"cxx" — C++ interop (Swift 5.9+ required)mainWhen both Swift and C++ have a main, Swift's usually wins. Force the C++ one:
set_values("swift.interop.cxxmain", true)
xmake f -p macosx -a arm64
xmake f -p iphoneos -a arm64
xmake f -p iphonesimulator -a arm64
xmake
Xmake picks up Xcode automatically. Pin SDK version with --xcode_sdkver=16.2, deployment target with --target_minver=12.0.
target("app")
add_files("src/*.swift")
add_scflags("-O") -- passed to swiftc
add_ldflags("-Wl,-dead_strip")
add_scflags = Swift compiler flags.
xmake f --toolchain=swift
xmake f --toolchain=swift --sdk=/Applications/Xcode.app/Contents/Developer
On Linux, install swift from swift.org and point --sdk at the install root.
swift.interop = "cxx" projects.target("...") that has .swift files produces a module; don't split Swift sources across unrelated targets without thinking about the module boundary.set_values("swift.modulename", ...). Interop uses the module name as the C++ namespace — default is the target name, and if that has hyphens you'll get invalid C++.swift.interop = "objc". Add a bridging header manually, or use the interop value.xmake-cross-compilationxmake-targetsxmake-cxx-modules (if using C++20 modules)What 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