From 5ec00f5373be19ecf77f9376584cdda5141f9890 Mon Sep 17 00:00:00 2001 From: David Capello Date: Mon, 4 Nov 2024 17:37:24 -0300 Subject: [PATCH] Disable some MSVC warnings from laf-base --- base/CMakeLists.txt | 21 ++++++++++++++++++++- gfx/path_skia.h | 9 --------- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/base/CMakeLists.txt b/base/CMakeLists.txt index e347b710b..80e3a3a2c 100644 --- a/base/CMakeLists.txt +++ b/base/CMakeLists.txt @@ -90,7 +90,26 @@ if(WIN32) # We only support the Unicode API UNICODE _UNICODE) - target_compile_definitions(laf-base PRIVATE _CRT_SECURE_NO_WARNINGS) + if(MSVC) + target_compile_options(laf-base PUBLIC + # Disable warnings about possible loss of data + -wd4244 + + # Disable warnings about conversion from size_t to int + -wd4267 + + # Disable warning about using 'this' used in base member initializer list + -wd4355 + + # Disable function not inlined (generated by MSVC header files) + -wd4710 + + # Avoid warnings about usage of insecure standard C library + # functions and C++ STL functions + -D_CRT_SECURE_NO_WARNINGS + -D_SCL_SECURE_NO_WARNINGS) + endif() + target_link_libraries(laf-base dbghelp shlwapi version) else() if(APPLE) diff --git a/gfx/path_skia.h b/gfx/path_skia.h index 1914b7b36..f96d00851 100644 --- a/gfx/path_skia.h +++ b/gfx/path_skia.h @@ -14,11 +14,6 @@ #include "include/core/SkPath.h" -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable:4244) // 'argument': conversion from 'T' to 'SkScalar', possible loss of data -#endif - namespace gfx { // Simple wrapper for SkPath @@ -119,8 +114,4 @@ namespace gfx { } // namespace gfx -#ifdef _MSC_VER -#pragma warning(pop) -#endif - #endif