diff --git a/CMakeLists.txt b/CMakeLists.txt index 8906a4181..08d483f2b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -271,6 +271,11 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") add_link_options("$<$:-fprofile-dir=${DEVILUTIONX_PROFILE_DIR};-fprofile-prefix-path=${CMAKE_CURRENT_BINARY_DIR}>") endif() +if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") + # u8path() function is deprecated but there is no sensible alternative and it might even get un-deprecated. + add_definitions(-D_SILENCE_CXX20_U8PATH_DEPRECATION_WARNING) +endif() + # Not a genexp because CMake doesn't support it # https://gitlab.kitware.com/cmake/cmake/-/issues/20546 if(NOT DISABLE_LTO) diff --git a/Source/utils/console.cpp b/Source/utils/console.cpp index af300423f..a8924b05d 100644 --- a/Source/utils/console.cpp +++ b/Source/utils/console.cpp @@ -30,7 +30,7 @@ void WriteToStderr(std::string_view str) HANDLE handle = GetStderrHandle(); if (handle == NULL) return; - WriteConsole(handle, str.data(), str.size(), NULL, NULL); + WriteConsole(handle, str.data(), static_cast(str.size()), NULL, NULL); } } // namespace