开发者

How to remove compiler flag when building Boost

开发者 https://www.devze.com 2023-01-01 14:20 出处:网络
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 f开发者_C百科lag (/clr) using CXXFLAGS, but this flag conflicts

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 f开发者_C百科lag (/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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消