Why might Xcode decide NOT to search headers recursively despite a build setting saying it should

StackOverflow https://stackoverflow.com/questions/13302923

  •  28-11-2021
  •  | 
  •  

Question

My project uses my personal library. In "header search paths", I have included "../WJLibrary/**". This is the correct relative path to my library. However according to the build log, it is not doing a recursive search. As a result, it is not finding all sorts of files that I need.

If I start adding the relevant subdirectories one by one, it starts finding files within those particular subdirectories. But that's no way to manage the project.

For what it's worth, I have an archived older version of the project, and in that version, everything works fine. I was changing some settings inside the library. And one of the changes must have broken something. But for the life of me, I can't figure out what could have caused it.

What could be causing this?

EDIT: Whatever the problem is, it's not something that's in the repository, as updating to older revisions does not help.

Was it helpful?

Solution 2

The answer appears to be that a recursive search path containing .. is not expanded. What I did to fix it was to create a symlink:

ln -s ../WJLibrary WJLibrary

Then I put in this recursive search path:

WJLibrary/**

At this point, everything worked.

OTHER TIPS

If you are not seeing the option in the build log, that means whatever setting you edited is not being propagated to the final "resolved" value. Xcode uses a cascading level system for its build settings. And it consists of these levels:

iOS Default Settings -> Project Settings -> Target Settings -> Final Resolved Setting

(Not to mention the .xcconfig files, but I'm guessing you don't have those)

If you are setting your path at the Project level, then there may be Target-level path that's overriding it. In the Xcode "Build Settings" window, make sure you select the "Levels" tab, so you can see all the settings of each level, with the left-most one being the final Resolved value.

Then there are the per-configuration settings, where you can set a different value for Debug vs Release builds. Make sure you're setting it right for the configuration you are running.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top