Skip to content

Flutter framework linker flag should only be set for iOS SDKs #54769

@jmagman

Description

@jmagman

Non-Flutter targets can use the FLUTTER_ build settings like FLUTTER_BUILD_NAME and FLUTTER_BUILD_NUMBER to keep version numbers in sync between executables. The easiest way to do that is for targets to inherit from the Debug.xcconfig and Release.xcconfig base configurations. However, #51453 introduced OTHER_LDFLAGS=$(inherited) -framework Flutter, so any target that does so would try to link on Flutter, even if the target does not use Flutter (and thus doesn't have Flutter in its search paths), or even is watchOS or tvOS.

One workaround is to conditionalize the build setting to the iOS SDK. That doesn't help with non-Flutter iOS targets, but it would mean watchOS and tvOS could use the xcconfig.

Context: #54691 (comment)

  1. Change to OTHER_LDFLAGS[sdk=iphone*]=$(inherited) -framework Flutter.
  2. Remove OTHER_LDFLAGS from flutter_export_environment.sh since OTHER_LDFLAGS[sdk=iphone*]` is not a valid environment variable, and host apps already link on Flutter and don't need this linker flag.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: existing-appsIntegration with existing apps via the add-to-app flowt: xcode"xcodebuild" on iOS and general Xcode project managementtoolAffects the "flutter" command-line tool. See also t: labels.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions