[llvm] CMake: Force MSVC to read code as UTF-8

Symptoms: https://github.com/clangd/clangd/issues/571

Reviewed By: kadircet

Differential Revision: https://reviews.llvm.org/D90116
This commit is contained in:
Kirill Bobyrev 2020-11-09 22:47:16 +01:00
parent ef7738240c
commit 4d81c8adb6
No known key found for this signature in database
GPG Key ID: 2307C055C8384FA0
1 changed files with 2 additions and 0 deletions

View File

@ -599,6 +599,8 @@ if(MSVC)
if (BUILD_SHARED_LIBS)
message(FATAL_ERROR "BUILD_SHARED_LIBS options is not supported on Windows.")
endif()
# Force MSVC to read code as UTF-8.
add_compile_options(/utf-8)
else()
option(LLVM_LINK_LLVM_DYLIB "Link tools against the libllvm dynamic library" OFF)
option(LLVM_BUILD_LLVM_C_DYLIB "Build libllvm-c re-export library (Darwin only)" OFF)