Search code examples
c++layoutboostbuildbjam

Boost build system not setting the compiler version tag for the output library names


This is a silly question but I cannot find anything in the boost documentation, the boost build system is not appending the correct compiler version tag to the libraries it produces.

Here is the command I use to build my boost 1.62.0 libraries:

b2 --build-dir=build toolset=msvc-12 address-model=64 threading=single link=shared,static variant=debug,release -j 12 --layout=versioned --stagedir=msvc

I expect to end up with libraries looking like this:

boost_date_time-vc120-mt-gd-1_62.dll

However, I have this:

boost_date_time-vc-mt-gd-1_62.dll

The build system is not setting the compiler version tag, leaving me only with vc instead of vc120.

From the documentation, the --layout=versioned option is supposed to get me the layout I want:

#   --layout=<layout>       Determines whether to choose library names
#                           and header locations such that multiple
#                           versions of Boost or multiple compilers can
#                           be used on the same system.
#
#                               versioned - Names of boost binaries
#                               include the Boost version number, name and
#                               version of the compiler and encoded build
#                               properties.  Boost headers are installed in a
#                               subdirectory of <HDRDIR> whose name contains
#                               the Boost version number.

Is there something I am missing? Why is the tag not set correctly?

Thank you.


Solution

  • After hours of pulling my hair out, I found the issue:

    toolset=msvc-12
    

    should in fact be:

    toolset=msvc-12.0
    

    Yes. That's it.

    The build system was happily building the libraries with msvc12 but was not able to add the compiler version without this '.0'.