[libcxx-commits] [PATCH] D97166: [libcxx] [docs] Update docs about how to build for Windows
Arthur O'Dwyer via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Sun Mar 14 19:40:53 PDT 2021
Quuxplusone accepted this revision.
Quuxplusone added a comment.
This revision is now accepted and ready to land.
LGTM, modulo one more re-rewrite. Again, I don't know much about Windows, but more documentation //ought// to always be a good thing. :)
Comment at: libcxx/docs/BuildingLibcxx.rst:129-133
+Note that if running in an MSYS2 shell and the MSYS2 provided clang package
+is installed, that one ends up picked up as tests invoke plain `clang++`
+instead of `clang-cl`. As the MSYS2 provided `clang++` binary defaults to
+a non-MSVC target, add `-DLIBCXX_TARGET_TRIPLE=x86_64-windows-msvc` to the
+cmake configuration in this case.
> Quuxplusone wrote:
> Thanks for the rewording.
> One tweak though; adding that `LIBCXX_TARGET_TRIPLE` doesn't make it call `clang-cl` instead of `clang++`, but it adds `-target x86_64-windows-msvc` to the `clang++` command line.
> What about "... you should tell `check-cxx` to make `clang++` use the right target by adding `-DLIBCXX_TARGET_TRIPLE=x86_64-windows-msvc` to the `cmake` command line above."?
Ah, I see. I'm not thrilled by the structure "You should tell X to do Y by Z'ing" because it's ambiguous whether //my// Z'ing will make X do Y, or whether I'm supposed to do something unspecified in order to make X do-Y-by-Z'ing. Therefore I suggest the following re-rewrite:
If you have installed the MSYS2-provided clang package (which defaults
to a non-MSVC target), you should add `-DLIBCXX_TARGET_TRIPLE=x86_64-windows-msvc`
to the `cmake` command line above. This will instruct `check-cxx` to use
the right target triple when invoking `clang++`.
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
More information about the libcxx-commits