Skip to content

x/mobile: enable building frameworks for Catalyst #36856

@losh11

Description

@losh11

As of macOS 10.15, users can build iPad apps to run on macOS using Catalyst. However if you build a framework using gomobile, even though the framework has support for x86_64, Xcode will display an error.

To fix this, all you need to do is target clang for the macOS sdk & add a cflag with -target x86_64-apple-ios13.0-macabi. Fully tested example below.

Gomobile should support specifying a target catalyst. In x/mobile/cmd/gomobile/env.go, add a new case "catalyst" for function envInit which looks like this:

case "catalyst":
    clang, cflags, err = envClang('macosx')
    cflags += " -target x86_64-apple-ios13.0-macabi"

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.help wantedmobileAndroid, iOS, and x/mobile

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions