How to remove compiler flag when building Boost
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.
精彩评论