windows 如何编译各种版本 boost 库

环境

系统:windows11
    boost版本:boost-1.70
    编译器版本:Visual Studio 2019

1. 参数分析

–without:选择不编译某个库

例如不编译python模块
    --without-python

–toolset:指定编译工具

例如指定vs2019
    --toolset=msvc-14.2

–stagedir:指定生成库所在位置,默认位置 stage/lib

--stagedir=stage142

2. 生成库名称规则分析

bjam  stage --toolset=msvc-14.2 --stagedir="D:\boost\boost_1_70_0\stage142" --without-python architecture=x86 address-model=64 link=static threading=multi runtime-link=static --build-type=complete release

bjam  stage --toolset=msvc-14.2 --stagedir="D:\boost\boost_1_70_0\stage142" --without-python architecture=x86 address-model=64 link=static threading=multi runtime-link=static --build-type=complete debug

bjam  stage --toolset=msvc-14.2 --stagedir="D:\boost\boost_1_70_0\stage142" --without-python architecture=x86 address-model=64 link=static threading=multi runtime-link=shared --build-type=complete release

bjam  stage --toolset=msvc-14.2 --stagedir="D:\boost\boost_1_70_0\stage142" --without-python architecture=x86 address-model=64 link=static threading=multi runtime-link=shared --build-type=complete debug

bjam  stage --toolset=msvc-14.2 --stagedir="D:\boost\boost_1_70_0\stage142" --without-python architecture=x86 address-model=64 link=shared threading=multi runtime-link=shared --build-type=complete debug

bjam  stage --toolset=msvc-14.2 --stagedir="D:\boost\boost_1_70_0\stage142" --without-python architecture=x86 address-model=64 link=shared threading=multi runtime-link=shared --build-type=complete release

库名称 库类型 链接方式 编译方式 编译器版本 线程 库位数
libboost_filesystem-vc142-mt-s-x64-1_70.lib link=static runtime-link=static release --toolset=msvc-14.2 threading=multi address-model=64
libboost_filesystem-vc142-mt-sgd-x64-1_70.lib link=static runtime-link=static debug --toolset=msvc-14.2 threading=multi address-model=64
libboost_filesystem-vc142-mt-x64-1_70.lib link=static runtime-link=shared release --toolset=msvc-14.2 threading=multi address-model=64
libboost_filesystem-vc142-mt-gd-x64-1_70.lib link=static runtime-link=shared debug --toolset=msvc-14.2 threading=multi address-model=64
libboost_filesystem-vc142-mt-gd-x64-1_70.dll link=shared runtime-link=shared debug --toolset=msvc-14.2 threading=multi address-model=64
libboost_filesystem-vc142-mt-x64-1_70.dll link=shared runtime-link=shared release --toolset=msvc-14.2 threading=multi address-model=64