From 111b858e12a6b2d419431e2e16fbcdbae94a211f Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Sat, 26 Mar 2022 18:13:47 +0100 Subject: 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. --- CMake/setup.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'CMake') diff --git a/CMake/setup.cmake b/CMake/setup.cmake index 8a7545f12..bf0e922e0 100644 --- a/CMake/setup.cmake +++ b/CMake/setup.cmake @@ -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) -- cgit v1.2.3