diff --git a/3rdparty/discord-rpc/CMakeLists.txt b/3rdparty/discord-rpc/CMakeLists.txt index 1877bb61d..cf6c2f0d6 100644 --- a/3rdparty/discord-rpc/CMakeLists.txt +++ b/3rdparty/discord-rpc/CMakeLists.txt @@ -33,6 +33,13 @@ if(APPLE) target_link_libraries(discord-rpc PRIVATE "-framework AppKit") endif() +# RapidJSON (as packaged by Homebrew and others) can trigger C++17 deprecation +# warnings (e.g. std::iterator) when compiled with AppleClang/libc++. +# Keep the suppression narrowly scoped to this 3rdparty target. +if(APPLE AND CMAKE_CXX_COMPILER_ID MATCHES "Clang") + target_compile_options(discord-rpc PRIVATE -Wno-deprecated-declarations) +endif() + if(WIN32) target_link_libraries(discord-rpc PRIVATE psapi advapi32) endif() diff --git a/CMakeLists.txt b/CMakeLists.txt index bc594050e..7275b4469 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1517,6 +1517,21 @@ qt_add_resources(SOURCES data/data.qrc data/icons.qrc) add_library(strawberry_lib STATIC ${SOURCES}) +# Treat Boost headers as system headers to avoid noisy warnings from 3rdparty +# Boost code (e.g. -Wold-style-cast) when building Strawberry with strict flags. +set(_strawberry_boost_system_includes "") +if(TARGET Boost::headers) + get_target_property(_strawberry_boost_system_includes Boost::headers INTERFACE_INCLUDE_DIRECTORIES) +elseif(TARGET Boost::boost) + get_target_property(_strawberry_boost_system_includes Boost::boost INTERFACE_INCLUDE_DIRECTORIES) +elseif(DEFINED Boost_INCLUDE_DIRS) + set(_strawberry_boost_system_includes "${Boost_INCLUDE_DIRS}") +endif() +if(_strawberry_boost_system_includes) + target_include_directories(strawberry_lib SYSTEM PRIVATE ${_strawberry_boost_system_includes}) +endif() +unset(_strawberry_boost_system_includes) + target_sources(strawberry PRIVATE src/main.cpp) if(WIN32)