Help us improve
Share bugs, ideas, or general feedback.
From xmake-skills
Builds Swift projects using xmake — supports binary/library targets, Swift ↔ C++/Objective-C interop, module name configuration, and iOS/macOS builds.
npx claudepluginhub xmake-io/xmake-skills --plugin xmake-skillsHow this skill is triggered — by the user, by Claude, or both
Slash command
/xmake-skills:xmake-swiftThe summary Claude sees in its skill listing — used to decide when to auto-load this 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.
Builds Objective-C / Objective-C++ projects with Xmake: `.m` / `.mm` files, Cocoa/Foundation frameworks, mixed C++, and macOS/iOS/tvOS targets.
Adds Swift Packages and links files to Xcode projects (.pbxproj). Invoked automatically when iOS dependencies like Firebase or Alamofire need installation.
Registers newly created .swift, .m, .mm, .c, .cpp, .h files with .xcodeproj via Ruby script so they appear in Xcode navigator and compile.
Share bugs, ideas, or general feedback.
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)