Skip to content

Commit

Permalink
Disable some MSVC warnings from laf-base
Browse files Browse the repository at this point in the history
  • Loading branch information
dacap committed Nov 5, 2024
1 parent a6476b4 commit 5ec00f5
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 10 deletions.
21 changes: 20 additions & 1 deletion base/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
9 changes: 0 additions & 9 deletions gfx/path_skia.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -119,8 +114,4 @@ namespace gfx {

} // namespace gfx

#ifdef _MSC_VER
#pragma warning(pop)
#endif

#endif

0 comments on commit 5ec00f5

Please sign in to comment.