用自定义进程替换 Xcode 的预处理器
我需要在预处理器尝试之前查看 Xcode 将编译的文件。简而言之,我需要在预处理器前面添加一个预处理器。
当涉及到如何在修改“C 源文件”的构建规则后运行基于 C 的文件的默认 Xcode 构建过程的详细信息时,所有 Google 搜索都让我一无所获。 Xcode 似乎调用了一个名为“CompileC”的进程(shell 脚本?巫术圣歌?),但在完成源文件后我找不到它来自己调用它。
有什么想法吗?出于好奇,我需要在非常特定的情况下修改某些宏(例如,取决于源文件的名称或构建日期)。似乎没有一个聪明的方法可以做到:#ifdef filename =“bobsyeruncle.m”
I have a need to look at the files Xcode will compile before the preprocessor gets a stab at them. In short, I need to stick a preprocessor in front of the preprocessor.
All the Google searching has netted me nada when it comes to details on how to run the default Xcode build process for C-based files after modifying the build rule for "C source files". Xcode seems to call a process (shell script? voodoo chant?) called "CompileC" but I cannot find it to call it myself after I'm done with the source file.
Any ideas? For the curious, I need to modify certain macros in very specific situations (depending on the source file's name or the build date, for example). And there doesn't appear to be a clever way to do: #ifdef filename="bobsyeruncle.m"
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看起来构建规则脚本可以工作: http://developer.apple.com/mac/library/documentation/DeveloperTools/Conceptual/XcodeBuildSystem/200-Build_Phases/bs_build_phases.html#//apple_ref/doc /uid/TP40002690-CJAEACAD
It looks like a build-rule script would work: http://developer.apple.com/mac/library/documentation/DeveloperTools/Conceptual/XcodeBuildSystem/200-Build_Phases/bs_build_phases.html#//apple_ref/doc/uid/TP40002690-CJAEACAD