Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce MSVC Warnings #135

Merged
merged 6 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,21 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON)
option(SST_JUCEGUI_BUILD_EXAMPLES "Add targets for building and running sst-filters examples" FALSE)

if (${SST_JUCEGUI_BUILD_EXAMPLES})
if (${PROJECT_IS_TOP_LEVEL})
if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
message(STATUS "Including reduced MSVC warning flags")
add_compile_options(
/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()

message(STATUS "Including SST JUCEGUI Examples")

if (NOT TARGET juce::juce_gui_basics)
Expand Down
3 changes: 1 addition & 2 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
add_subdirectory(component-demo)
add_subdirectory(scxt-wireframes)
add_subdirectory(component-demo)
12 changes: 0 additions & 12 deletions examples/scxt-wireframes/CMakeLists.txt

This file was deleted.

126 changes: 0 additions & 126 deletions examples/scxt-wireframes/MainWindow.h

This file was deleted.

64 changes: 0 additions & 64 deletions examples/scxt-wireframes/SCXTWireframesMain.cpp

This file was deleted.

3 changes: 1 addition & 2 deletions src/sst/jucegui/components/GlyphPainter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,10 @@ void paintFromSvg(juce::Graphics &g, const juce::Rectangle<int> &into, const std
auto res = juce::Drawable::createFromImageData(svg.data(), svg.size());
dbls[path] = std::move(res);
}
catch (std::exception &e)
catch (std::exception &)
{
g.setColour(juce::Colours::red);
g.fillRect(into);
// oh well
}
}

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