开发者

Objective-C++ pre-compiled headers

开发者 https://www.devze.com 2023-01-01 04:09 出处:网络
I\'m using a C++ library (it happens to be in an iPad application, but I\'m not sure that should make any difference) and would really like to have the headers pre-compiled to speed up the builds, but

I'm using a C++ library (it happens to be in an iPad application, but I'm not sure that should make any difference) and would really like to have the headers pre-compiled to speed up the builds, but xCode seems to run the pre-compiled header file through the C compiler rather than the C++ one.

Is there a way to get it to use the right compiler? I've already changed all of my source files开发者_运维技巧 from .m to .mm.


According to the Xcode docs, a compiled header is generated for each language variant. So if you bracket your #include with guard macros, it should work i.e.

#if defined __cplusplus
#include "mycplusplusheader.h"
#endif
0

精彩评论

暂无评论...
验证码 换一张
取 消