On Tue, 4 Dec 2018 at 13:08, Paul A. Bristow via Boost-users < boost-users@lists.boost.org> wrote:
*From:* Boost-users [mailto:boost-users-bounces@lists.boost.org] *On Behalf Of *degski via Boost-users *Sent:* 30 November 2018 20:40 *To:* boost-users@lists.boost.org *Cc:* degski *Subject:* Re: [Boost-users] LLVM bitcode for Boost libraries?
On Fri, 30 Nov 2018 at 16:09, Osman Zakir via Boost-users < boost-users@lists.boost.org> wrote:
So you mean I should use Clang-C2/Clang with Microsoft CodeGen, aka the clang-cl compiler? Either way, how do I change the compiler toolchain when building Boost?
No, that's dead for a [quite] while now, just get and install Clang/LLVM from https://releases.llvm.org/download.html#7.0.0.
AFAIK, the final Boost-1.69 release [or current dev branch] will allow for building with clang-cl **and lld-link** [Thanks to Peter Dimov]. You'll need to have a project-jam file something like this:
import option ; using clang-win : : "C:\\Program Files\\LLVM\\bin\\clang-cl.exe" -fuse-ld=lld : <compatibility>vc14 <compileflags>-fmsc-version=1915 <compileflags>-fms-compatibility <compileflags>-fno-delayed-template-parsing <compileflags>-flto=thin <cxxflags>"/std:c++17" <cxxflags>"/Zc:forScope" <cxxflags>"/Zc:wchar_t" <cxxflags>"/EHsc" <cxxflags>"/Zc:inline" <cxxflags>"/Gd" <cxxflags>"/diagnostics:classic" <cxxflags>-Wno-unknown-argument <cxxflags>-Wno-unknown-pragmas <cxxflags>-Wno-macro-redefined <cxxflags>-Wno-unused-variable <cxxflags>-Wno-mismatched-tags <cxxflags>-Wno-deprecated-declarations <cxxflags>-D_UNICODE <cxxflags>-DUNICODE <cxxflags>-DBOOST_USE_WINDOWS_H <cxxflags>-DBOOST_NO_ANSI_APIS <cxxflags>-DBOOST_USE_WINAPI_VERSION=0x1000 <cxxflags>-DBOOST_USE_WINDOWS_H=1 <cxxflags>-DNOMINMAX <cxxflags>-DWIN32_LEAN_AND_MEAN <cxxflags>-D_CRT_SECURE_NO_WARNINGS ;
But you'll have to adjust that to your needs.
Before I bash my head against this configuration again, please can you confirm that this does this work for you to build the Boost libraries **on Windows** so that one can use the Boost.Test library (not header-only)?
Am I right on thinking that
All the / items are to allow compilation of MSVC stuff.
Is it essential to use <cxxflags>"/EHsc" ? when
test suite using Boost. emits a warning that EHa should be enabled:
*warning C4535: calling _set_se_translator() requires /EHa*
All the –Wno- items are to deal with a blizzard of warnings from MSVC stuff?
<cxxflags>-D_CRT_SECURE_NO_WARNINGS is need to avoid C runtime warnings.
And all the other –D items are only needed if you want to use more than empty project console applications?
You can probably forget everything after the line <cxxflags>"/std:c++17", the rest is indeed mostly to have a build log with as little nonsense as possible and I picked /EHsc, because this seems to be the default in the IDE. I don't build the test suite, but the libs build quite nicely. degski PS: @Paul, was not clear to me who wrote what [who was abusing his head], so maybe I missed something. -- *“If something cannot go on forever, it will stop" - Herbert Stein*