在 BJam 中更改 gcc 编译器可执行文件名称
如何更改编译器可执行文件名称?我想对一些使用 BJam 作为构建系统的产品执行“假构建”。 (例如:Boost 本身)在这个“假构建”中,我希望调用一些特殊命令而不是 g++。 (使用真实 gcc 的真实构建中使用的所有选项和环境)。
如何执行此操作?是否有任何命令行开关已经允许我执行我需要的操作,或者我可以以某种方式修改 *.jam 文件来实现我需要的操作?
How to change compiler executable name? I want to perform a "fake build" of some products which are using BJam as build system. (For example: the Boost itself) In this "fake build" I want some special command to be called instead of g++. (with all the options and environment used in real build with real gcc).
How to perform this? Are there any command line switches which already allows me to do what I need or maybe I can somehow modify *.jam files to achieve what I need?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最简单的事情可能只是切换您的路径,以便 gcc 指您想要运行的内容。否则,bjam 的正确做法就比较挑剔了。我从未让它成功、轻松地工作,但这是文档的建议:
您需要将命令添加到项目的 Jamroot 来配置 gcc 模拟命令。最简单的方法就是:
但很可能您的 jam 规则(或 site-config.jam)中的某处有另一个
using gcc ;
行,并且您会收到有关尝试重新初始化工具集的投诉。如果是这样,您需要为工具集提供一个显式版本,如下所示,并在编译时使用该工具集,使用命令
bjam toolset=gcc-mywrapper
。祝你好运。
The easiest thing might to just switch your path so gcc refers to what you want to run. Otherwise, the correct way to do it bjam is more finicky. I've never gotten it to successfully, easily work, but here's what the docs suggest:
You'll need to add command to the Jamroot of your project to configure the gcc mocking command. The simplest way is just:
But most likely you have another
using gcc ;
line somewhere in your jam rules (or site-config.jam) and you'll get a complaint about trying to reinitialize a toolset. If so, you'll need to give an explicit version to the toolset like soAnd to use this toolset when compiling use the command
bjam toolset=gcc-mywrapper
.Good luck.