This is related to preserve include path in xcode, but is the complimentary problem.
We are organizing our code on disk into logical components with folders like:
ComponentA/HeaderA.h
ComponentB/HeaderB.h
and require that team members import them like
#import "ComponentA/HeaderA.h"
#import "ComponentB/HeaderB.h"
We use the USER_HEADER_SEARCH_PATHS pointing at the directory above ComponentA/B to enable the compiler to find these, it works fine.
However, these headers are included in the Xcode project, so if someone accidentally uses
#import "HeaderA.h"
#import "HeaderB.h"
then Xcode will still find the header, but we want it to produce a compiler error. Is there a way to get Xcode to stop finding these headers unless the hierarchical name is used?
It turns out that this has been asked before in
controlling which project header file Xcode will include
The key undocumented setting is USE_HEADERMAP=NO, which stops Xcode from automatically finding any header file that has been added to the project.