从bash导入$ PATH到Xcode [英] importing $PATH from bash into Xcode

查看:90
本文介绍了从bash导入$ PATH到Xcode的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将bash PATH环境变量(在~/.bash_profile中设置的环境变量)导入一个特定的Xcode项目(我正在使用Xcode 11).

I want to import the bash PATH environment variable (where it is set in ~/.bash_profile) into one particular Xcode project (I'm using Xcode 11).

这是因为我要使用Makefile编译该Xcode项目,并且Makefile使用bash PATH环境变量.具体来说,我使用通过MacPorts安装的编译器和库,因此我希望Xcode像Makefile一样在/opt/local/bin:/opt/local/sbin中显示.

This is because I want to use a Makefile compile that Xcode project, and the Makefile uses the bash PATH environment variable. Specifically I use compilers and libraries that I installed using MacPorts, so I want Xcode to look in /opt/local/bin:/opt/local/sbin, like the Makefile does.

在Xcode中,我尝试在Edit scheme > Environment VariablesBuild Settings中为项目及其(外部构建)目标添加这些对象,如

In Xcode I've tried adding these in Edit scheme > Environment Variables, and in Build Settings for both the project and its (external-build) target, as described in the answers to this question, but it hasn't appeared to have made a difference.

(我要解决的特定问题在我的问题在这里.)

(The specific problem that I'm trying to fix is described in my question here.)

推荐答案

我解决了产生此问题的更大问题.请参阅我对我的原始问题的回答.

I worked it out how to do the bigger issue that generated this question. See my answer to my original question.

我不确定哪个确切的部分或哪个组合正确地将PATH从bash导入Xcode,回答了这个问题.

I'm not sure which exact part, or which combination, imported the PATH correctly from bash into Xcode, answering this question.

当我最初问这个问题时,我肯定已经在Build settingsEnvironment Variables中输入了PATH.也许不同之处在于在第5步此处上选中了Pass build settings in environment复选框,我不确定在我问时是否这样做这个问题.

I had definitely entered the PATH into Build settings and Environment Variables when I originally asked this question. Perhaps the difference was ticking the Pass build settings in environment checkbox in step 5 here, which I am not sure whether I did when I asked this question.

无论如何现在都可以使用.

In any case it works now.

这篇关于从bash导入$ PATH到Xcode的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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