Skip to content

Commit

Permalink
Reduce MSVC Warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
baconpaul committed Nov 25, 2024
1 parent 55af8e4 commit de984f2
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
14 changes: 14 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,20 @@ if (${SST_JUCEGUI_BUILD_EXAMPLES})
add_library(JUCE INTERFACE)
endif ()
add_subdirectory(examples)
if (${PROJECT_IS_TOP_LEVEL})
if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
set(OS_COMPILE_OPTIONS
/bigobj
/wd4244 # convert float from double
/wd4305 # truncate from double to float
/wd4018 # signed unsigned compare
/wd4996 # don't warn on stricmp vs _stricmp and other posix names
/wd4267 # converting size_t <-> int
/wd4005 # macro redefinition for nominmax
/utf-8
)
endif ()
endif()
endif ()

if (NOT TARGET juce::juce_gui_basics)
Expand Down
10 changes: 10 additions & 0 deletions src/sst/jucegui/style/StyleSheet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,17 @@ struct StyleSheetBuiltInImpl : public StyleSheet
const juce::Font &f) override
{
jassert(isValidPair(c, p));

#if defined(_MSC_VER)
#pragma warning(push)
#pragma warning(disable : 4996)
#endif

fonts[c.cname][p.pname] = f;

#if defined(_MSC_VER)
#pragma warning(pop)
#endif
}

void replaceFontsWithTypeface(const juce::Typeface::Ptr &p) override
Expand Down

0 comments on commit de984f2

Please sign in to comment.