如何构建命令行实用程序 [英] How to build command line utility

查看:168
本文介绍了如何构建命令行实用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含命令行实用程序的框架。此应用程序由第三方应用程序调用以执行某些任务。没有办法我可以绕过没有这个实用程序。

I have a framework that includes a command line utility. This application is called by third party applications to perform certain tasks. There is no way I can go around not having this utility.

我写了代码,并将.m文件添加到我的项目。我为Core Foundation类型创建了一个新的目标。我将正确的文件添加到构建阶段下的编译源部分。但是由于某些原因,Xcode不构建我的实用程序。每当我构建框架并展开产品组时,命令行实用程序都保留为红色。

I've written the code and added the .m file to my project. I created a new target for it of the Core Foundation type. I added the right files to the Compile Sources section under Build Phases. But for some reason, Xcode doesn't build my utility. Whenever I build the framework and expand the Products group, the command line utility is left red.

如何强制Xcode构建它?

How do I force Xcode to build it?

推荐答案

不知道我是否正确理解你。

你有一个框架与实用程序,你想包括该实用程序你的边界?比您可能需要将该实用程序添加到构建阶段的复制文件部分


或者您想在您的项目中构建实用程序吗?

您可能需要向您的项目添加命令行工具目标。

编辑:要链接两个目标,只需将依赖关系目标添加到主要目标的阶段。

Don't sure if I understand you correctly.

You have a framework with utility and you want to include that utility to your boundary? Than you probably need to add that utility to "Copy Files" section of "Build Phases"

Or you want to build utility in your project?
Than you probably need to add "Command line tool" target to your project.
Edit: To link two targets just add dependcy target to the "Target Dependencies" section of "Build Phases" of the main target.

这篇关于如何构建命令行实用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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