Reputation: 1354
I'm aware that the new toolset is not supported by boost yet but I'd like to try to build Boost with it anyways. I've naively tried using the Boost build system and the option toolset=msvc-12.0-ctp
but it doesn't work. I'm confident that it is possible since Boost 1.55 officially supports Visual Studio 2013 (msvc-12.0) and there have only been few breaking changes between the two releases.
My motivation is that I need some features of the CTP so my own application will be compiled with the CTP version of the msvc compiler. I'm afraid that simply compiling Boost with the original 2013 compiler will cause binary incompatibilities between Boost and my own application. Stephen T. Lavavej himself doesn't guarantee binary compatibility:
-- any chance of reusing Boost Binaries built for MSVC 2013 in MSVC Nov 2013 CTP
Because this is compiler-only, you can probably get away with mixing-and-matching. I wouldn't recommend it, though.
Any thoughts on how to solve this? Thanks in advance.
Upvotes: 0
Views: 3047
Reputation: 13005
Note, that I did not built Boost with Visual Studio 2013 November CTP, so further explanations are purely theoretical.
After some Googling and trying, finally, I did it. So, algorithm is:
Check out latest Boost from subversion (probably, it can be done with release distro, but I did not tried)
svn co http://svn.boost.org/svn/boost/trunk boost-trunk
Specify custom path to compiler in user-config.jam
file, which is situated in %BOOST_HOME%/tools/build/v2/
(where %BOOST_HOME%
is a path where you checked out your distro):
using msvc : 12.1 : "C:/Program Files (x86)/Microsoft Visual C++ Compiler Nov 2013 CTP/bin/cl" ;
you can use arbitrary string instead of 12.1
, just put something here to distinguish your toolset later, when invoking b2
Don't forget to put spaces before and after colon and before semicolon, and also use slashes /
or double backslashes \\
instead of backslashes \
. See explanation in comments of user-config.jam
file
Make sure that you don't have #
in the beginning of the line (i.e. it is not commented)
Run VS2013 x86 Native Tools Command prompt
or run manually cmd.exe
and then set up environment by invoking "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" -x86
. Change x86
to x64
if needed.
Add path to CTP compiler to PATH
variable :
set PATH=C:/Program Files (x86)/Microsoft Visual C++ Compiler Nov 2013 CTP/bin;%PATH%
Check that path to CTP compiler goes before path to release one:
echo %PATH%
Go to %BOOST_HOME%
and run b2 toolset=msvc-12.1 ...<other params go there>...
In process manager or ProcessExplorer check that b2
invokes CTP compiler, and not release one
Unfortunately, not all libraries builds fine. There are some compile errors.
See also:
Hope it helps. Happy building! =)
Upvotes: 4