Bug: Xcode 26.2 wants `ENABLE_DEBUG_DYLIB`: How do I enable that in `Package.swift`?

Xcode tells me

Previewing in executable targets now requires a new build layout for unoptimized builds. Either set ENABLE_DEBUG_DYLIB to YES for this target, or break out your preview code into a separate framework with its own scheme.

How do enable that in Package.swift. swiftSettings don't work (.define and unsafeFlags with -D ...).

Creating a library product that the executable then depends on doesn't help either.

I have two targets, one is an executable target. The #Preview macro is in the non-executable target.

Xcode Version 26.2 (17C52), macOS Sequoia 15.7.3, using toolchain bundled with Xcode.

Bug: Xcode 26.2 wants `ENABLE_DEBUG_DYLIB`: How do I enable that in `Package.swift`?
 
 
Q