I have to warn you I’m not an Xcode expert and I’m having a very annoying with it at the moment.
I have a static library project originally built from Jucer on which I have added a new target for unit tests (gtest). At first everything seemed to work properly but I quickly noticed that I was’t in fact running the latest version of my library in the unit tests. In fact, no matter what I was fixing in an existing method always ended up in a failed test. While debugging I noticed that the debug breakpoints were “aliased”, like if what I was writing wasn’t linked into the final google test executable. On the other hand, when Xcode compiles the library it will complain if anything is wrong with the source code… so Xcode does compile the code I have in front of my eyes at one point.
So it seems that in the end Xcode is linking some sort of zombie and old version of the static library only during the final linking… which I couldn’t find until I changed this “derived data” folder in Xcode’s global preferences to output all the build artefacts next to my project.
I tried to clean thousand times, to add/remove the library in “link binary with libraries”… totally running out of idea. Now since I changed this Derived Data location it just doesn’t find the library anymore. Seems like a progress but I cannot explain what is going on.
The only thing I’ve noticed is that Projucer doesn’t seem to make a regular configuration for static library project. In Building Phases it doesn’t have any “Link binary with libraries” option… I wonder if it would be behind this very annoying side-effect?
Sorry, like I said I’m unfortunately not an Xcode expert so let me know if I can paste any hint here.
Thank you very much all!