From 3361e71036ee716c46db01e8055ee4e426d56cdc Mon Sep 17 00:00:00 2001 From: NyakoFox Date: Sun, 10 Mar 2024 20:55:40 -0300 Subject: [PATCH] Add MSVC version check --- desktop_version/CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/desktop_version/CMakeLists.txt b/desktop_version/CMakeLists.txt index b1639a62..fbb33fef 100644 --- a/desktop_version/CMakeLists.txt +++ b/desktop_version/CMakeLists.txt @@ -295,8 +295,10 @@ if(MSVC) string(REPLACE "/GR" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /GR-") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /utf-8") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /utf-8") + if(MSVC_VERSION GREATER 1900) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /utf-8") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /utf-8") + endif() else() string(REGEX REPLACE "-std=[a-z0-9]+" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99")