[PATCH] D90116: [clangd] Escape Unicode characters to fix Windows builds

Aleksandr Platonov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 2 05:12:50 PST 2020


ArcsinX added a comment.

In D90116#2353440 <https://reviews.llvm.org/D90116#2353440>, @kbobyrev wrote:

> Hmm, I see. From the looks of it, the solution for several projects would be
>
>   add_compile_options("$<$<C_COMPILER_ID:MSVC>:/utf-8>")
>   add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/utf-8>")
>
> But I'm not sure if it makes sense in our case and I don't see many `add_compile_options` in LLVM. Also, I don't have a way to test it out.



- I brought up the environment to reproduce this problem and can confirm, that this solution with `add_compile_options` works.
- Adding  `-DCMAKE_CXX_FLAGS="/utf-8" -DCMAKE_C_FLAGS="/utf-8"` into cmake command also helps (so, maybe we can update build documentation for MSVC (here? https://llvm.org/docs/CMake.html#microsoft-visual-c ) instead of  changes inside `llvm/CMakeLists.txt`)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D90116/new/

https://reviews.llvm.org/D90116



More information about the cfe-commits mailing list