Some checks failed
Build / Build openSUSE (leap:15.6) (push) Has been cancelled
Build / Build openSUSE (leap:16.0) (push) Has been cancelled
Build / Build openSUSE (tumbleweed) (push) Has been cancelled
Build / Build Fedora (42) (push) Has been cancelled
Build / Build Fedora (43) (push) Has been cancelled
Build / Build Fedora (44) (push) Has been cancelled
Build / Build OpenMandriva (cooker) (push) Has been cancelled
Build / Build Mageia (9) (push) Has been cancelled
Build / Build Debian (bookworm) (push) Has been cancelled
Build / Build Debian (forky) (push) Has been cancelled
Build / Build Debian (trixie) (push) Has been cancelled
Build / Build Ubuntu (noble) (push) Has been cancelled
Build / Build Ubuntu (questing) (push) Has been cancelled
Build / Build Ubuntu (resolute) (push) Has been cancelled
Build / Upload Ubuntu PPA (noble) (push) Has been cancelled
Build / Upload Ubuntu PPA (questing) (push) Has been cancelled
Build / Upload Ubuntu PPA (resolute) (push) Has been cancelled
Build / Build FreeBSD (push) Has been cancelled
Build / Build OpenBSD (push) Has been cancelled
Build / Build macOS Public (release, macos-15) (push) Has been cancelled
Build / Build macOS Public (release, macos-15-intel) (push) Has been cancelled
Build / Build macOS Private (release, macos-arm64) (push) Has been cancelled
Build / Build Windows MinGW (i686, debug) (push) Has been cancelled
Build / Build Windows MinGW (i686, release) (push) Has been cancelled
Build / Build Windows MinGW (x86_64, debug) (push) Has been cancelled
Build / Build Windows MinGW (x86_64, release) (push) Has been cancelled
Build / Build Windows MSVC (arm64, debug, arm64 debug, windows-11-arm) (push) Has been cancelled
Build / Build Windows MSVC (arm64, release, arm64 release, windows-11-arm) (push) Has been cancelled
Build / Build Windows MSVC (x86, debug, x86 debug, windows-2022) (push) Has been cancelled
Build / Build Windows MSVC (x86, release, x86 release, windows-2022) (push) Has been cancelled
Build / Build Windows MSVC (x86_64, debug, x86_64 debug, windows-2022) (push) Has been cancelled
Build / Build Windows MSVC (x86_64, release, x86_64 release, windows-2022) (push) Has been cancelled
Build / Upload (push) Has been cancelled
Build / Attach to release (push) Has been cancelled
This commit introduces a new compile option in the discord-rpc CMake configuration to suppress C++17 deprecation warnings triggered by RapidJSON when compiled with AppleClang. Additionally, it treats Boost headers as system headers in the Strawberry library to reduce warning noise during builds with strict flags. These changes aim to improve the build experience and maintain cleaner output logs.
53 lines
1.5 KiB
CMake
53 lines
1.5 KiB
CMake
set(DISCORD_RPC_SOURCES
|
|
discord_rpc.h
|
|
discord_register.h
|
|
discord_rpc.cpp
|
|
discord_rpc_connection.h
|
|
discord_rpc_connection.cpp
|
|
discord_serialization.h
|
|
discord_serialization.cpp
|
|
discord_connection.h
|
|
discord_backoff.h
|
|
discord_msg_queue.h
|
|
)
|
|
|
|
if(UNIX)
|
|
list(APPEND DISCORD_RPC_SOURCES discord_connection_unix.cpp)
|
|
if(APPLE)
|
|
list(APPEND DISCORD_RPC_SOURCES discord_register_osx.m)
|
|
add_definitions(-DDISCORD_OSX)
|
|
else()
|
|
list(APPEND DISCORD_RPC_SOURCES discord_register_linux.cpp)
|
|
add_definitions(-DDISCORD_LINUX)
|
|
endif()
|
|
endif()
|
|
|
|
if(WIN32)
|
|
list(APPEND DISCORD_RPC_SOURCES discord_connection_win.cpp discord_register_win.cpp)
|
|
add_definitions(-DDISCORD_WINDOWS)
|
|
endif()
|
|
|
|
add_library(discord-rpc STATIC ${DISCORD_RPC_SOURCES})
|
|
|
|
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()
|
|
|
|
if(TARGET RapidJSON::RapidJSON)
|
|
target_link_libraries(discord-rpc PRIVATE RapidJSON::RapidJSON)
|
|
elseif(RapidJSON_INCLUDE_DIRS)
|
|
target_include_directories(discord-rpc SYSTEM PRIVATE ${RapidJSON_INCLUDE_DIRS})
|
|
endif()
|
|
target_include_directories(discord-rpc PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|