Skip to content

Commit

Permalink
Auto merge of #1015 - micbou:msvc-utf8, r=puremourning
Browse files Browse the repository at this point in the history
[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 -->
  • Loading branch information
zzbot authored Apr 27, 2018
2 parents 00269d1 + 4ddf4cf commit d328184
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,10 @@ endif()

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

if( MSVC OR CYGWIN OR MSYS)
Expand Down

0 comments on commit d328184

Please sign in to comment.