"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)