/xmake-skills:xmake-objcfrom xmake-skills
Builds Objective-C and Objective-C++ projects with xmake, covering .m/.mm sources, Cocoa/Foundation frameworks, C++ mixing, and macOS/iOS/tvOS targets.
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.
Objective-C (.m) and Objective-C++ (.mm) are first-class in xmake. Primary use case: macOS / iOS / tvOS apps, Cocoa frameworks, and mixed C++ / Objective-C projects.
add_rules("mode.debug", "mode.release")
target("hello")
set_kind("binary")
add_files("src/*.m")
add_frameworks("Foundation")
// src/main.m
#import <Foundation/Foundation.h>
int main() {
@autoreleasepool {
NSLog(@"hello from xmake");
}
return 0;
}
Use .mm extension and set the C++ language level:
target("app")
set_kind("binary")
set_languages("c++17")
add_files("src/*.mm", "src/*.cpp")
add_frameworks("Foundation", "AppKit")
.mm files compile with the Objective-C++ front-end — you can freely mix @interface/@implementation with C++ classes and templates.
target("app")
add_frameworks("Foundation", "Cocoa", "AppKit", "Metal", "MetalKit", "CoreGraphics")
add_frameworkdirs("/Library/Frameworks", "$(projectdir)/vendor/frameworks")
add_frameworks(...) — system or user frameworks (equivalent of -framework <name>).add_frameworkdirs(...) — additional search paths for non-system frameworks.target("app")
add_mflags("-fobjc-arc") -- Objective-C flag (.m)
add_mxxflags("-fobjc-arc") -- Objective-C++ flag (.mm)
add_mflags / add_mxxflags target .m / .mm respectively; add_cxflags still flows through to both.
ARC is the default in modern Xcode; include -fobjc-arc explicitly if you want to be sure.
xmake f -p macosx -a arm64
xmake f -p iphoneos -a arm64
xmake f -p iphonesimulator -a arm64
xmake f -p appletvos -a arm64
xmake f -p watchos -a arm64
xmake
Pin SDK version and minimum deployment:
xmake f -p iphoneos --xcode_sdkver=17.2 --target_minver=14.0
For a proper .app bundle on macOS:
target("myapp")
add_rules("xcode.application") -- produces .app
add_files("src/*.m", "res/*.storyboard", "res/*.xcassets")
add_files("res/Info.plist")
add_frameworks("Foundation", "AppKit")
iOS app:
target("myapp")
add_rules("xcode.application")
set_plat("iphoneos")
add_files("src/*.m", "res/Info.plist")
add_frameworks("Foundation", "UIKit")
xcode.application is a built-in rule that produces a proper bundle with Info.plist, code signing hooks, etc.
See xmake-swift — Swift interop picks up Objective-C headers via set_values("swift.interop", "objc").
Objective-C is a strict superset of C, so a .m file can #include <stdio.h> freely. Pure C headers compile inside .m/.mm files without extra flags.
.mm without set_languages("c++XX"). Defaults to C++98 which is almost never what you want. Set it explicitly.add_frameworks("SwiftUI") fails on old macOS SDKs. Pin with --xcode_sdkver= or gate with is_plat + minver.-fobjc-arc on old code. Pre-ARC code uses retain/release; modern code uses ARC. Don't mix arbitrarily.xcode.application needs an Info.plist in add_files or it produces a broken bundle.xmake-cross-compilation, xmake-toolchainsxmake-swiftxmake-targetsxmake-xpackWhat 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`.Other plugins' skills for the same job