Objective-C ++ precompiled headers

I use the C ++ library (this happens in an iPad application, but I'm not sure it should matter), and I really want the headers to be precompiled to speed up the build, but xCode seems to run precompiled header file via C compiler, not C ++.

Is there a way to get it to use the correct compiler? I have already changed all the source files from .m to .mm.

+4
source share
1 answer

According to Xcode docs , a compiled header is created for each language variant. Therefore, if you copy #include with security macros, it should work ie

#if defined __cplusplus #include "mycplusplusheader.h" #endif 
+7
source

Source: https://habr.com/ru/post/1311205/


All Articles