Skip to content

Commit d328184

Browse files
authored
Auto merge of #1015 - micbou:msvc-utf8, r=puremourning
[READY] Force MSVC to treat source files as UTF-8 encoded Compilation fails with a lot of these errors: ``` error C3688: invalid literal suffix '唷'; literal operator or literal operator template 'operator ""唷' not found ``` when the system local is Chinese on Windows. This is fixed by forcing MSVC to use UTF-8. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/valloric/ycmd/1015) <!-- Reviewable:end -->
2 parents 00269d1 + 4ddf4cf commit d328184

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cpp/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,10 @@ endif()
178178

179179
# For MSVC enable UNICODE and compilation on multiple processors. Increase the
180180
# number of sections that an object file can hold. This is needed for storing
181-
# the Unicode table.
181+
# the Unicode table. Also, force MSVC to treat source files as UTF-8 encoded.
182182
if ( MSVC )
183183
add_definitions( /DUNICODE /D_UNICODE /Zc:wchar_t- )
184-
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP /bigobj" )
184+
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP /bigobj /utf-8" )
185185
endif()
186186

187187
if( MSVC OR CYGWIN OR MSYS)

0 commit comments

Comments
 (0)