在 Xcode 4 中添加自定义目标
我正在尝试将 Xcode 与具有自定义构建系统的现有项目一起使用。它有几个不同的平台目标,我希望能够指定其中任何一个并轻松构建它。 Xcode 所要做的就是运行 make build-platform DEBUG=1
或类似的东西。
我创建了一个外部构建系统项目(在 Mac OS X 类别下,因为这是唯一的选择。)我唯一可预见的问题是目标列表。我现在在这里看到的是:
- 我的 Mac 64 位
- 我的 Mac 32 位
我已经到处寻找我能想到的更改这些,但无济于事。我需要这里不同平台的列表。我该如何做到这一点,以及根据目标自定义构建设置的正确方法是什么?
(注意:我可能还可以使用每个平台的方案来完成此工作,但我宁愿使用目的地来完成此工作。无论哪种方式,我仍然需要知道如何根据活动设置更改 make 目标。)
I'm trying to use Xcode with an existing project that has a custom build system. It has several different platform targets, and I'd like to be able to specify any one of these and build it easily. All Xcode has to do is run make build-platform DEBUG=1
or something similar.
I've created an External Build System project (under the Mac OS X category, since that was the only option.) My only foreseeable problem is the Destination list. All I see here now is:
- My Mac 64-bit
- My Mac 32-bit
I've looked everywhere I can think of to change these, but to no avail. I need a list of different platforms here. How can I do this, and what would be the correct way to customize the build settings based on the destination?
(Note: I could probably also make this work with schemes for each platform, but I'd rather do it with destinations. Either way I still need to know how to get the make target to change based on the active setting.)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我必须在 Xcode 4 中使用外部 Makefile 项目,它只是 32 位。在我看来,删除“My Mac 64-bit”项目的技巧是将体系结构值(ARCH)设置为“i386”。
在 Info 选项卡中,我设置 makefile 选项和目标:
这些更改实际上只是 Xcode 菜单项的修饰 - 由我的构建 makefile 来构建正确的体系结构。我没有勾选“pass build settings ...”,所以我忽略了 ARCH 设置,以及其余的设置。
我不需要 i386 和 x86-64,但如果需要,我需要添加规则makefile 来构建通用二进制文件。
Xcode 4 中的外部 makefile 项目支持对于让 Xcode 显示正确的目标类型来说有点繁琐,但它似乎确实有效。请注意,默认情况下,添加另一个目标时它会自动创建方案;您最终可能会得到比预期更多的方案,或者方案与其目标之间不匹配。我重新命名我的目标和计划以适应。
希望这有帮助。
I have to work with an external Makefile project in Xcode 4, it's 32-bit only. It seems to me the trick to remove the "My Mac 64-bit" item was to set the architecture value (ARCH) to "i386".
In the Info tab I'm setting the makefile options and target:
These changes are really only cosmetic for Xcode's menu items - it's up to my build makefiles to build for the correct architectures. I have the "pass build settings ..." un-ticked, so I'm ignoring ARCH setting, and the rest for that matter.
I don't need i386 and x86-64, but if I did I would need to add rules to makefiles to build a universal binary.
The external makefile project support in Xcode 4 is a bit fiddly to get Xcode to show the correct target types, but it does seem to work. Watch out that by default it'll auto-create schemes when adding another target; you might end up with more schemes than you expected, or a mis-match between a scheme and it's target. I rename my targets and schemes to suite.
Hope this helps.
如果您想单独构建平台,则需要创建单独的配置。否则,XCode 构建步骤会将您在配置中定义的所有已定义架构构建为单个二进制文件(例如 i386 + x86_64)。无论构建是从 XCode 的 IDE 还是从 xcodebuild 命令行运行,都是如此,我假设您使用的是后者,因为您有外部构建系统。
If you want to build the platforms separately, you will need to create individual configurations. Otherwise the XCode build step will build all defined architectures you have defined in the configuration into a single binary (eg. i386 + x86_64). This is true whether the build is run from XCode's IDE or from the xcodebuild command line, I'll presume you are using the latter as you have an external build system.