If I do

b2 toolset=msvc-12.0
versus
b2 toolset=msvc-14.0

the libraries and executables will be built and linked using the right toolset.

But what about the prebuilt libraries? I tried something like the following in the Jamfile for boost:

lib atomic :
           : <target-os>windows
             <address-model>32
             <search>$(BOOST_LIB32)
             <variant>debug
             <toolset>msvc-12.0
             <name>libboost_atomic$(BOOST_DEBUG_VC120_SUFFIX)
          :
          : <include>$(BOOST_INCLUDE)
            <source>system
          ;

lib atomic :
           : <target-os>windows
             <address-model>32
             <search>$(BOOST_LIB32)
             <variant>debug
             <toolset>msvc-14.0
             <name>libboost_atomic$(BOOST_DEBUG_VC140_SUFFIX)
          :
          : <include>$(BOOST_INCLUDE)
            <source>system
          ;

This doesn't work, because b2 complains that it can't match all of the properties. If I remove the <toolset> property from the first instance of atomic and do

b2 toolset=msvc-14.0

It still uses the default version of msvc (for me that's 12.0) and ignores the second one that has <toolset>msvc-14.0.

Is there some way for b2 to use the right prebuilt library, depending on the toolset?