summaryrefslogtreecommitdiff
path: root/CMake
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2022-03-26 18:13:47 +0100
committerAlbrecht Schlosser <albrechts.fltk@online.de>2022-03-26 18:13:47 +0100
commit111b858e12a6b2d419431e2e16fbcdbae94a211f (patch)
tree1312dc72dc1e1f8e1c4fb2a5b8568ff32563adec /CMake
parent6f06265e86c910b32fb31d23954a186c86d9ef1f (diff)
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.
Diffstat (limited to 'CMake')
-rw-r--r--CMake/setup.cmake4
1 files changed, 3 insertions, 1 deletions
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)