Derived Data does not contain a copy of Headers from Framework and use case build behavior is bizarre

I have a simple C++ program that #includes a header from a framework (#include <SDL2/SDL.h>). My program both compiles correctly initially and then complains (in Xcode) that the header file can't be found. The compiler is looking at the Derived Data copy of the framework the second time it compiles, which does not include the Headers folder, so it then fails building. If I then clean the build folder and start again , the program builds and runs once correctly.

Listing the framework headers in the "Public Headers" section does not work for me because the headers includes other headers which are using the <framework-name / header-file-name> for their includes.

Is this a bug or am I missing something that fixes the problem?

Derived Data does not contain a copy of Headers from Framework and use case build behavior is bizarre
 
 
Q