"Show Live Issues" problem in Xcode with CMake generator and possible improvement

By default, CMake generates a .xcodeproj file, Xcode can index the code properly, but the Show Live Issues feature doesn’t work with this file. Code issues are only shown after building,

However, if I create a new Xcode workspace in a different directory (not the same one as the generated .xcodeproj), and then add the CMake-generated .xcodeproj file to the workspace (either by copying or moving it), everything works as expected — including Show Live Issues.

I’m not sure what changes after adding it to a workspace, but perhaps the CMake Xcode generator could be improved by that.

CMake Version: 4.0.2
Xcode : Version 16.0 (16A242d)
System: MacOS 15.5 (24F74)

Given the rigorousness of the lack of documentation for Xcode project files, we’d really need to know what is actually different between the two cases so that we could generate projects supporting this behavior.