Command parameters for b2 in order to build Boost libraries with Microsoft's Clang/C2

落爺英雄遲暮 提交于 2020-01-04 04:56:46

问题


I have been trying to compile Boost libraries using b2 in Windows but using Clang/C2 (Clang 3.7 with Microsoft CodeGen), to no success. Since Visual Studio comes with several toolsets to use at build time, it seems it shouldn't be too hard to specify which. I have seen another posting relating to "building boost with clang 3.8 on windows" but his proposal to use as command line for b2 is in error because it is not really invoking the clang compiler from MSVC. The person posting that used the following command line:

b2 --build-dir=build toolset=clang --build-type=complete stage

I am a stranger to b2 and the Boost.Build tools... all I want is to use Boost from MSVC with Clang/C2 instead of the default compiler.

Any feedback will be greatly appreciated..

Juan Dent

BTW: I am using Visual Studio 2015 Update 3.


回答1:


boost supports clang on mac os x so it should build it on windows and linux.

On windows boost builds for visual studio by default. When building for mingw I run bootstrap.bat mingw before b2. So to build for clang on windows, ensure that clang is in the PATH and try:

cd boost_1_xx_0
bootstrap.bat clang

b2 -j8 toolset=clang address-model=64 architecture=x86 --build-dir=build --build-type=complete stage


来源:https://stackoverflow.com/questions/38153049/command-parameters-for-b2-in-order-to-build-boost-libraries-with-microsofts-cla

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!