Skip to content

Commit 4d81c8a

Browse files
committed
[llvm] CMake: Force MSVC to read code as UTF-8
Symptoms: clangd/clangd#571 Reviewed By: kadircet Differential Revision: https://reviews.llvm.org/D90116
1 parent ef77382 commit 4d81c8a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

llvm/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,8 @@ if(MSVC)
599599
if (BUILD_SHARED_LIBS)
600600
message(FATAL_ERROR "BUILD_SHARED_LIBS options is not supported on Windows.")
601601
endif()
602+
# Force MSVC to read code as UTF-8.
603+
add_compile_options(/utf-8)
602604
else()
603605
option(LLVM_LINK_LLVM_DYLIB "Link tools against the libllvm dynamic library" OFF)
604606
option(LLVM_BUILD_LLVM_C_DYLIB "Build libllvm-c re-export library (Darwin only)" OFF)

0 commit comments

Comments
 (0)