Xcode generator changes Swift language semantics
This is almost certainly, fundamentally, a bug in Swift or Xcode and not in CMake, but even if that's true, it's possible CMake can do something to avoid it.
The problem is described fully here. Please let me know if you want more information directly in this issue; I'm happy to edit it.