b2的命令参数,以便使用Microsoft的Clang / C2构建Boost库

时间:2016-07-01 19:52:46

标签: c++ c++11 boost clang

我一直在尝试使用Windows中的b2编译Boost库,但使用Clang / C2(Clang 3.7与Microsoft CodeGen),但没有成功。由于Visual Studio附带了几个在构建时使用的工具集,因此似乎不应该太难指定哪个。我看过另一篇关于“在Windows上使用clang 3.8构建提升”的帖子,但是他建议用作b2的命令行是错误的,因为它并没有真正从MSVC调用clang编译器。发布使用以下命令行的人员:

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

我是b2和Boost.Build工具的陌生人...我想要的是使用来自MSVC的Boost与Clang / C2而不是默认编译器。

非常感谢任何反馈..

Juan Dent

BTW:我正在使用Visual Studio 2015 Update 3。

1 个答案:

答案 0 :(得分:0)

boost支持clang上的mac os x,因此应该在windowslinux上构建它。

默认情况下,windows boost版本为visual studio。构建mingw时,我会在bootstrap.bat mingw之前运行b2。因此,要在clang上构建windows,请确保clang位于PATH并尝试:

cd boost_1_xx_0
bootstrap.bat clang

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