使用 Xcode 进行通用 C/C++发展

发布于 2024-11-27 04:58:34 字数 289 浏览 1 评论 0原文

我想将 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

桃酥萝莉 2024-12-04 04:58:34

我找到了启用重构工具的(脏)路径:

我向项目添加了一个新的标准“控制台目标”,并在“构建阶段”>“构建阶段”下添加了所有源文件。编译来源。

重构工具现在可以使用了。有两个目标似乎不是一个相关的问题(除了优雅)

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)

知你几分 2024-12-04 04:58:34

就我个人而言,我不会尝试使用旧版 Makefile,尽管我认为对此有一些支持。

通常,我对传统 C/C++ 项目所做的是将 XCode 项目文件夹存储在项目的根目录下。所以它可能看起来像:

--myApp
  --src
  --inc
  --myApp 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:

--myApp
  --src
  --inc
  --myApp Xcode

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).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文