Skip to content

A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.

3.6 KB
Raw Blame
# The iOS app shell: signing + packaging around libestella_ios.a, which
# `node build-tools/cli.js native --target ios --dawn ... --quickjs ...` produces
# in build/cmake/native-ios/ (host + engine + QuickJS + Dawn, merged).
#
#   brew install xcodegen && cd native/ios && xcodegen && open EstellaiOS.xcodeproj
#
# Then pick your Team under Signing & Capabilities and Run on a device. An
# exported project's content ships as bundle resources, the way the APK ships it
# under assets/ — the host reads both through the same project-relative paths.
name: EstellaiOS

# The app's identity — bundle id and version — comes from the exported project,
# written here by `cli native --target ios` (which must run before xcodegen
# anyway: this project links the xcframework it produces). Keeping it out of this
# committed file is what lets two projects build from one checkout.
include:
  - app.generated.yml

options:
  bundleIdPrefix: com.estella
  deploymentTarget:
    iOS: "17.0"
  createIntermediateGroups: true

targets:
  EstellaiOS:
    type: application
    platform: iOS
    sources:
      - path: App
      # An exported project, staged by `cli native --target ios --content <dir>`.
      # A folder reference (not a group) so cooked subdirectories keep their
      # shape — the host reads Content/ first, the bundle root second.
      - path: Content
        buildPhase: resources
        type: folder
    settings:
      base:
        # PRODUCT_BUNDLE_IDENTIFIER / MARKETING_VERSION come from app.generated.yml.
        # Info.plist is generated from App/Info.plist.in at the same time.
        INFOPLIST_FILE: App/Info.plist
        # -ObjC keeps the view controller / app delegate classes in the static
        # library alive; the linker would otherwise drop TUs nothing references.
        OTHER_LDFLAGS: -ObjC -lc++
        TARGETED_DEVICE_FAMILY: "1,2"
        ENABLE_BITCODE: NO
        # arm64 only, devices and simulator alike: the CMake build and Dawn are
        # both arm64: a Release simulator build would otherwise also want x86_64,
        # which no slice provides. (An Intel-Mac simulator needs its own Dawn.)
        ARCHS: arm64
    dependencies:
      # An .xcframework, not a bare .a: device and simulator are different target
      # triples whose objects cannot link together, and Xcode picks the slice that
      # matches whatever the toolbar is pointed at. Build the simulator slice with
      # `cli native --target ios --simulator`.
      - framework: ../../build/cmake/native-ios/Estella.xcframework
        embed: false
      - sdk: UIKit.framework
      - sdk: CoreMotion.framework
      - sdk: CoreHaptics.framework
      - sdk: Metal.framework
      - sdk: QuartzCore.framework
      - sdk: IOSurface.framework
      - sdk: CoreGraphics.framework
      # Core Text names the font file the glyph rasterizer parses (main_ios.mm).
      - sdk: CoreText.framework
      - sdk: Foundation.framework
      # miniaudio's CoreAudio backend (native_audio.cpp), linked at build time
      # because it forces MA_NO_RUNTIME_LINKING on Apple.
      - sdk: AVFoundation.framework
      - sdk: CoreAudio.framework
      - sdk: AudioToolbox.framework

# No `schemes:` here on purpose. Without one Xcode autocreates the scheme under
# xcuserdata, which xcodegen never overwrites — so a developer's Diagnostics
# choices survive a regenerate. A shared scheme would be rewritten every time.
# (Metal API Validation has to be turned off once: Dawn calls setDepthClipMode
# unconditionally and the simulator's Metal lacks it. An EXPORTED project ships
# its scheme as a build artifact, so that one has the setting baked in — see
# build-tools/utils/xcodeProject.js.)