compile flags for SwiftUI previews

Xcode complains that my app needs the -Onone optimisation level to use previews, while the current setting was -O. Is there a way to change the compile flags for SwiftUI previews from CMake?

Even if I change CMAKE_Swift_FLAGS for all five configurations, I still get the same error, which indicates that the compile flags for previews are read from somewhere else.