Xcode tells me
Previewing in executable targets now requires a new build layout for unoptimized builds. Either set
ENABLE_DEBUG_DYLIBtoYESfor 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.