如何为外部构建项目启用Xcode重构选项? [英] How can I enable Xcode refactor options for an external build project?

查看:178
本文介绍了如何为外部构建项目启用Xcode重构选项?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用XCode作为开发一些AVR代码的IDE。我做了以下



1)创建新项目



2)选择外部构建系统



3)表示我想要这样做,并告诉它不要在环境中传递构建设置



4)复制我的 .c / .h / Makefile进入我在



5中创建项目的同一目录)5)添加了 .c / /em>.h文件到项目/目标



6)验证我可以从命令行和Xcode构建(make)$ /

但我不能使用任何重构菜单选项,或跳转到/显示选项。似乎没有符号信息。没有办法使用Xcode不仅仅是一个使用外部构建系统的简单C编辑器??如果没有,这是嵌入式开发的一个突破。请告诉我我错了:(

解决方案

我找到了一个解决方法/解决方案,创建一个名为Dummy的第二个目标类似的,这是基于类型为C的命令行工具模板。选择所有.c文件,并在左侧栏的目标窗格中,检查新的Dummy项目(或如果选项更改,因为它们似乎经常,做任何必要的手势使Dummy依赖于你的C文件)。



它将创建一个Dummy目录和一些其他可以删除的Dummy文件如果你想要的话,你永远不会打扰建立虚拟,事实上,如果它是一个嵌有独立工具链的项目,似乎几乎100%,它不会被编译为OSX的命令行工具。)



显然,XCode需要这个间接提示才能知道你的.c文件确实是真正的C文件,可以这样解析/内省。



当您添加外部构建系统可能的新.c文件时请自动查看,确保将其作为虚拟目标的依赖项。


I want to use XCode as an IDE for developing some AVR code. I did the following

1) create new project

2) select external build system

3) indicated i want it to be make, and told it NOT to "Pass build settings in environment"

4) copied my .c/.h/Makefile into the same directory i created the project in

5) added the .c/.h files to the project/target

6) verified that i can build (make) from both command line and Xcode

But I cannot use any of the refactor menu options, or jump to/reveal options. There appears to be no symbol information. Is there no way to use Xcode as more than just a simple C editor that uses an external build system????

If not, it's a bust for embedded development. Please tell me I'm wrong :(

解决方案

I found a workaround/solution. Create a second target called "Dummy" or something like that, that is based on the Command Line Tool template of type C. Select all the .c files and in the "Targets" pane on the left side bar, check the new Dummy project (or if the options change, as they seem to often, do whatever gestures necessary to make Dummy depend on your C files).

It will create a Dummy directory and a couple of other Dummy files which you can remove if you want. You never bother building 'Dummy', in fact, if it's an embedded project with separate toolchain, likelihood is nearly 100% that it won't compile as a Command Line Tool for OSX anyway. :)

Apparently XCode needs this indirect hint to know that your .c files are indeed real C files and can be parsed/introspected as such.

As you add new .c files which your external build system likely see automatically, make sure you include them as a dependent for the Dummy target.

这篇关于如何为外部构建项目启用Xcode重构选项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆