From a4dd6e58eb44d4c875ac457c0e11eabb5aa4b467 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 | 24 +++++++++++++++++++++++- gfx/path_skia.h | 9 --------- 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/base/CMakeLists.txt b/base/CMakeLists.txt index e347b710b..001e82af0 100644 --- a/base/CMakeLists.txt +++ b/base/CMakeLists.txt @@ -90,9 +90,31 @@ 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() + # Disable warnings about signed/unsigned comparison + #target_compile_options(laf-base PUBLIC -Wno-sign-compare) + if(APPLE) target_compile_options(laf-base PRIVATE -fobjc-arc) 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