4712: CMake: Use /utf-8 for MSVC r=def- a=TsFreddie

Because the good guy microsoft respects the old habit of using local codepages for source code in Asia.
(In china and japan MSVC defaults to treating the source code as GBK and SHIFT_JIS encoded still.)

## Checklist

- [ ] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: Freddie Wang <tsfreddiewang@gmail.com>
This commit is contained in:
bors[bot] 2022-02-15 14:50:41 +00:00 committed by GitHub
commit b4d699dc1c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2769,6 +2769,7 @@ foreach(target ${TARGETS})
target_compile_options(${target} PRIVATE /EHsc) # Only catch C++ exceptions with catch.
target_compile_options(${target} PRIVATE /GS) # Protect the stack pointer.
target_compile_options(${target} PRIVATE /wd4996) # Use of non-_s functions.
target_compile_options(${target} PRIVATE /utf-8) # Use UTF-8 for source files.
endif()
if(OUR_FLAGS_LINK)
target_link_libraries(${target} ${OUR_FLAGS_LINK})