Does libc++ support to be referenced/included and compiled on Windows with Clang/LLVM as native? For native, I mean no dependence on mingw and cygwin. I didn't find much doc on this but I believe it should be supported as clang for Windows has been released for a long time.
Just an update. There is experimental support now (early 2018):
https://libcxx.llvm.org/docs/BuildingLibcxx.html#experimental-support-for-windows
(from the link)
Assming you have Ninja, and libcxx/llvm both checked out, libcxx can be compiled via
> cmake -G Ninja ^
-DCMAKE_MAKE_PROGRAM=/path/to/ninja ^
-DCMAKE_SYSTEM_NAME=Windows ^
-DCMAKE_C_COMPILER=clang-cl ^
-DCMAKE_C_FLAGS="-fms-compatibility-version=19.00 --target=i686--windows" ^
-DCMAKE_CXX_COMPILER=clang-cl ^
-DCMAKE_CXX_FLAGS="-fms-compatibility-version=19.00 --target=i686--windows" ^
-DLLVM_PATH=/path/to/llvm/tree ^
-DLIBCXX_ENABLE_SHARED=YES ^
-DLIBCXX_ENABLE_STATIC=NO ^
-DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=NO ^
\path\to\libcxx
> /path/to/ninja cxx
As of 4/23/18, it will install into Program Files (x86) even if compiled for x86-64... (which can be done by changing i686 to x86_64 in the above).
Update in November 2020: I now use a package called llvm-mingw.
This package includes the clang compiler toolchain with wrappers to support various gcc style executables (e.g. gcc.exe, g++.exe, x86_64-w64-mingw32-gcc.exe) and can be used out of the box to compile against the mingw libc++ (you don't have to install mingw separately, the mingw libraries come with the package).
llvm-mingw is still young but has most features of mingw-w64. Features that are not implemented are:
Releases are available at the authors github repo. I have a binary installer available at my winlua.net site.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With