[PATCH] D157986: [Cmake] Make sure MSVC knows LLVM source files are UTF-8 encoded
Corentin Jabot via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 16 09:25:04 PDT 2023
cor3ntin updated this revision to Diff 550787.
cor3ntin added a comment.
Only set the execution charset of tests
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D157986/new/
https://reviews.llvm.org/D157986
Files:
llvm/cmake/modules/AddLLVM.cmake
llvm/cmake/modules/HandleLLVMOptions.cmake
Index: llvm/cmake/modules/HandleLLVMOptions.cmake
===================================================================
--- llvm/cmake/modules/HandleLLVMOptions.cmake
+++ llvm/cmake/modules/HandleLLVMOptions.cmake
@@ -489,6 +489,9 @@
_UNICODE
)
+ # Tell MSVC the LLVM sources are UTF-8 encoded.
+ append("/source-charset:utf-8" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
+
if (LLVM_WINSYSROOT)
if (NOT CLANG_CL)
message(ERROR "LLVM_WINSYSROOT requires clang-cl")
Index: llvm/cmake/modules/AddLLVM.cmake
===================================================================
--- llvm/cmake/modules/AddLLVM.cmake
+++ llvm/cmake/modules/AddLLVM.cmake
@@ -1589,6 +1589,10 @@
list(APPEND LLVM_COMPILE_FLAGS "-Wno-gnu-zero-variadic-macro-arguments")
endif()
+ if(MSVC)
+ list(APPEND LLVM_COMPILE_FLAGS "/execution-charset:utf-8")
+ endif()
+
if (NOT DEFINED LLVM_REQUIRES_RTTI)
set(LLVM_REQUIRES_RTTI OFF)
endif()
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D157986.550787.patch
Type: text/x-patch
Size: 944 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230816/36740358/attachment.bin>
More information about the llvm-commits
mailing list