add: Discord-RPC warning patch

This commit is contained in:
collecting
2025-10-07 07:19:10 +00:00
parent 89300b17bf
commit 3e11537f38

View File

@@ -461,6 +461,30 @@ else()
message(WARNING "Could not find stb_image.h to patch. It may not have been downloaded yet.") message(WARNING "Could not find stb_image.h to patch. It may not have been downloaded yet.")
endif() endif()
# Apply a patch to discord-rpc's CMakeLists.txt to suppress -Wclass-memaccess
message(STATUS "Applying custom patch to submodule's discord-rpc CMakeLists.txt...")
# Define the path to the patch file and the target directory using unique names
set(DISCORD_RPC_PATCH_FILE "${CMAKE_CURRENT_SOURCE_DIR}/patches/discord-rpc-wclass-memaccess-fix.patch")
set(DISCORD_RPC_PATCH_TARGET_DIR "${CMAKE_CURRENT_SOURCE_DIR}/externals/discord-rpc")
# Check if the target directory exists before trying to patch
if(EXISTS "${DISCORD_RPC_PATCH_TARGET_DIR}")
execute_process(
COMMAND git apply --ignore-whitespace "${DISCORD_RPC_PATCH_FILE}"
WORKING_DIRECTORY "${DISCORD_RPC_PATCH_TARGET_DIR}"
RESULT_VARIABLE PATCH_RESULT
OUTPUT_QUIET
ERROR_QUIET
)
if(NOT PATCH_RESULT EQUAL 0)
message(WARNING "Failed to apply discord-rpc CMakeLists.txt patch! This might be okay if it's already applied.")
endif()
else()
message(WARNING "Could not find discord-rpc directory to patch. It may not have been downloaded yet.")
endif()
if (ENABLE_QT) if (ENABLE_QT)
if (NOT USE_SYSTEM_QT) if (NOT USE_SYSTEM_QT)
download_qt(6.7.3) download_qt(6.7.3)