XCode 10 stopped detecting changes in C++ header files

I have a C++ project I've been working on fine in XCode 9, where when I edit a header file it automatically detects which object files need to be recompiled when I go to build/run the program. As of XCode 10.0 (10A255), however, when I make edits to my header files, XCode doesn't detect the changes and doesn't recompile anything when I try to build/run. So I have to clean the entire build folder and rebuild everything any time I make changes to a header file. Anyone else have this issue?

Replies

Yes, our team is hitting this issue as well. Did you open a radar by any chance, I can add that to my rader ?

So Xcode 9 previewed a new build system, 10 made this the default and this is causing the issue. I switched back to the “Legacy build system” and it picks up the header changes.

It's not consistently picking up the header changes for me. Also switching to Legacy Build stops me from being able to clean the project.

If this is the same issue I met since Xcode 10, then a solution, which is odd but still faster than cleaning the whole build is updating the related implementation file (anything more meaningful for the compiler than a comment, for example a change of a variable value or adding a bogus variable, which can be incremented each time the header changes). Any change made to the .m file seems to force its header update.

My project was previously using the legacy build settings, but after updating to Xcode 14, none of my code changes were recompiling. Cleaning, touching, resaving, etc did not help in my case. I was able to fix this by going to File > Project Settings > Advanced, and selecting Xcode Default (it was previously set to Legacy). After doing this, all my code changes recompiled as expected.