Boost logo

Boost-Build :

Subject: Re: [Boost-build] Compiler flags for MSVC8
From: Johan Nilsson (r.johan.nilsson_at_[hidden])
Date: 2009-09-28 03:35:25


John.X.Foster_at_[hidden] wrote:
> Hi
>
> Sorry if this question has been asked before - if so please redirect
> me to the relevant thread.
>
> I am buliding under MSVC8. In this version, Microsoft have introduced
> various annoying compiler defaults which I normally avoid using the
> following defines:
>
> _HAS_ITERATOR_DEBUGGING=0
> _CRT_NONSTDC_NO_DEPRECATE
> _CRT_SECURE_NO_DEPRECATE
> _SECURE_SCL=0
> _SCL_SECURE_NO_DEPRECATE
>
> For the Boost libraries which must be built as libraries, eg regex, I
> need to build them with these compiler flags. I have done this for
> regex by modifying the vc8.mak file. Is there a generic way of
> setting these flags in the jamroot or other file, so I dont need to
> modify particular files for each library?

As you seem to build the Boost Libraries "offline" you could modify the
project definition inside the Jamroot (if you are ok with hacking the
Jamroot):

project boost
        : requirements
        ...
        <toolset>msvc:<define>_CRT_SECURE_NO_DEPRECATE
        <toolset>msvc:<define>_SCL_SECURE_NO_DEPRECATE
        <toolset>msvc:<define>_HAS_ITERATOR_DEBUGGING=0
        <toolset>msvc:<define>_CRT_NONSTDC_NO_DEPRECATE
        <toolset>msvc:<define>_SECURE_SCL=0
        ...
        ;

Then use Boost.Build to rebuild the libraries. Use "bjam -a ..." as the
above won't trigger rebuilds if you've already built the stuff once using
Boost.Build (contradicted by your statements above, but just to make sure).

HTH / Johan


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk