CMake/MSVC: limit "/utf-8" to VS 2015 and later (PR #415)

According to PR #415 this switch was added in Visual Studio 2015
Update 3. However, version "1900" does not distinguish updates,
hence Visual Studio 2015 up to Update 2 may fail to compile with
this addition. Installing the updates would obviously fix this.
This commit is contained in:
Albrecht Schlosser 2022-03-26 18:13:47 +01:00
parent 6f06265e86
commit 111b858e12

View File

@ -116,7 +116,9 @@ if (WIN32)
if (MSVC)
add_definitions (-DWIN32_LEAN_AND_MEAN)
add_definitions (-D_CRT_SECURE_NO_WARNINGS)
add_compile_options (/utf-8) # This is equivalent to specifying `/source-charset:utf-8 /execution-charset:utf-8`
if (NOT MSVC_VERSION VERSION_LESS 1900) # Visual Studio 2015
add_compile_options (/utf-8) # equivalent to `/source-charset:utf-8 /execution-charset:utf-8`
endif ()
set (BORDER_WIDTH 2)
endif (MSVC)
if (CMAKE_C_COMPILER_ID STREQUAL GNU)