Set APPLICATION_EXTENSION_API_ONLY on a SPM package

On Xcode 13b5 I get linking against a dylib which is not safe for use in application extensions warnings for all my dynamically linked Swift packages. I was able to reproduce this with a new project:

  1. Create a Swift package and set its product type to dynamic.
  2. Create a watchOS app or iOS app extension.
  3. Import and link the Swift package as a local dependency.
  4. Build the app.

Result:

ld: warning: linking against a dylib which is not safe for use in application extensions: ~/Library/Developer/Xcode/DerivedData/MyApp-gtbdztwxcysffgeyceqelchgacqm/Build/Products/Debug-watchsimulator/PackageFrameworks/MyPackage.framework/MyPackage

The warnings don't appear in Xcode 12. Is this expected behavior or still a bug?