Requirement: Visual stuio 2019 LLVM : http://releases.llvm.org/8.0.0/LLVM-8.0.0-win64.exe
Step 1: Install Visual studio 2019
Step 2: Install LLVM (remember to check add llvm to system enviroment path)
Step 3: Check if clang is work: Open cmd, type:
clang --version
clang version 8.0.0 (tags/RELEASE_800/final)
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: C:\LLVM\bin
Step 4: Download boost library source code: https://dl.bintray.com/boostorg/release/1.70.0/source/
step 4:
cd C:\boost_source_dir
step 5: Edit project-config.jam file in boost source dir
# Boost.Build Configuration
# Automatically generated by bootstrap.bat
import option ;
using clang
:
:
:
cxxstd=17
<ranlib>"C:/LLVM/bin/llvm-ranlib.exe"
<archiver>"C:/LLVM/bin/llvm-ar.exe"
<cxxflags>-D_CRT_SECURE_NO_WARNINGS
<cxxflags>-D_SILENCE_CXX17_OLD_ALLOCATOR_MEMBERS_DEPRECATION_WARNING
;
option.set keep-going : false ;
step 6: Compile boost
bootstrap
b2 cxxstd=17 link=static address-model=64 --layout=tagged --build-type=complete --architecture=x64 --threading=multi toolset=clang --without-python --withtout-icu variant=release
It's will give a lot of warning for deprecated functions, but it works.
Fuck it's still the only way to make it work with clang on Windows in 2020! You are God man!