I'm seeing a similar issue with using SDL2 with Xcode 15.3. When I clean the build directory (command+shift+K), my command line utility compiles directly afterwards. But subsequent builds attempts fail, and I'm getting a message header files are not found. A documentation build fails every time, and so far seems the most reliable way to reproduce the issue.