使用 Xcode 进行通用 C/C++发展
我想将 Xcode 的所有功能用于通用 C/C++ 项目,但我不知道配置新 Xcode 项目并将其附加到现有源代码树的基本步骤是什么一个遗留的、简单的 C/C++ 项目。
创建一个新的空项目,将其附加到源代码树并配置构建目标(使用 GNU Make)是一项非常愚蠢的任务。
我不知道如何启用源代码索引,以便启用源代码重构工具、搜索和快速跳转以及使 Xcode 程序员的生活变得更加美好的所有便利设施。 此外,我想使用内部调试工具……
有人向我指出教程、提示或任何有用的东西吗?
谢谢
I'd like to use all the power of Xcode for generic C/C++ projects but I can't figure out what are the basic steps to configure a new Xcode project and attach it to an existing source tree of a legacy, plain, C/C++ project.
Creating a new empty project, attaching it to a source tree and configuring a build target (using GNU Make) was a really silly task.
I can't figure out how to enable source code indexing in order to enable source refactoring tools, searching and fast-jumping and all the amenities that makes the Xcode programmer's life great.
Moreover I'd like to use the internal debugging facilities…
Does anyone point me to a tutorial, a hint or whatever could be useful?
Thanx
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我找到了启用重构工具的(脏)路径:
我向项目添加了一个新的标准“控制台目标”,并在“构建阶段”>“构建阶段”下添加了所有源文件。编译来源。
重构工具现在可以使用了。有两个目标似乎不是一个相关的问题(除了优雅)
I've found a (dirty) path to enable refactoring tools:
I've added a new standard «console target» to the project and added all the source files under the Build Phases > Compiled Sources.
Refactoring tools now works. Having two targets doesn't seem to be a relevant issue (elegance apart)
就我个人而言,我不会尝试使用旧版 Makefile,尽管我认为对此有一些支持。
通常,我对传统 C/C++ 项目所做的是将 XCode 项目文件夹存储在项目的根目录下。所以它可能看起来像:
然后我将 src 文件夹和 inc 文件夹拖到项目导航器中。这给了我一个在 Mac 上编译的 Xcode 项目,然后我有了在 Linux 上编译的传统 Makefile(实际上,我更喜欢在其他平台上使用 CMake,但无论哪种方式都可以)。
Personally, I wouldn't attempt to use legacy Makefiles, even though I think there's some support for that.
Typically what I do with a traditional C/C++ project is to store my XCode project folder at the root of the project. So it might look like:
I then drag the src folder and inc folder into the project navigator. This gives me an Xcode project to compile with on the Mac, and then I have the traditional Makefile for compiling on Linux (actually, I prefer CMake for other platforms, but either way works).