如何构建的刺激时,除去编译器标志 [英] How to remove compiler flag when building Boost

查看:124
本文介绍了如何构建的刺激时,除去编译器标志的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要建立一个非标准的标志集升压(由于升压线程和C ++ / CLI之间的冲突)。我添加使用CXXFLAGS要求的标志(/ CLR),但与升压默认这个标志的冲突/ EHS标志(/ CLR隐含/ EHA这与/ EHS不兼容),这样,必须燮pressed。有没有像CXXFLAGS一种机制来共进晚餐preSS默认升压标志或我必须手动编辑所有的编译器规范文件的?

I need to build Boost with a non-standard set of flags (due to a conflict between Boost threading and C++/CLI). I'm adding the required flag (/clr) using CXXFLAGS, but this flag conflicts with the Boost default /EHs flag (/clr implies /EHa which is incompatible with /EHs), so that needs to be suppressed. Is there a mechanism like CXXFLAGS to suppress a default Boost flag or must I edit all of the compiler specification files by hand?

推荐答案

有没有办法去除这些特定选项。你需要做的就是指定一个具体的构建变量匹配您正试图建立什么。如果你看看 msvc.jam (<一个href=\"https://svn.boost.org/trac/boost/browser/tags/release/Boost_1_43_0/tools/build/v2/tools/msvc.jam\"相对=nofollow>在这里看到),它里面列出它把在各个 / EH * 选项,你会发现一个部分(<一个href=\"https://svn.boost.org/trac/boost/browser/tags/release/Boost_1_43_0/tools/build/v2/tools/msvc.jam#L1160\"相对=nofollow>在这里看到)。正如你所看到的第三个匹配 / EHA 你想为C ++ / CLI。这意味着与构建: bjam的非同步的异常=上的extern-C-抛出异常= ON&lt;保证ARGS的制造&gt休息; 。在异常处理上显然不是必要的,因为在默认情况下你得到的,而不会被看到 / EHS 在首位的选择。

There's no way to remove those particular options. What you need to do is specify a specific build variant that matches what you are attempting to build. If you look at the msvc.jam (see here) you'll find a section where it lists the various /EH* options it puts in (see here). As you can see the third one matches the /EHa you want for C++/CLI. This translates to building with: bjam asynch-exceptions=on extern-c-nothrow=on <rest of the args>. The exception-handling-on is obviously not needed since by default you get that, and would not be seeing the /EHs option in the first place.

这篇关于如何构建的刺激时,除去编译器标志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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