diff --git a/CMakeLists.txt b/CMakeLists.txt index 00dd5237be..4e12c7a99c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -658,7 +658,7 @@ if(ENABLE_QT) set_target_properties(Qt6::Platform PROPERTIES INTERFACE_COMPILE_FEATURES "") endif() -if (YUZU_CRASH_DUMPS) +if (WIN32 AND YUZU_CRASH_DUMPS) set(BREAKPAD_VER "breakpad-c89f9dd") download_bundled_external("breakpad/" ${BREAKPAD_VER} "breakpad-win" BREAKPAD_PREFIX "c89f9dd") diff --git a/src/yuzu/CMakeLists.txt b/src/yuzu/CMakeLists.txt index cf87d5c997..38b7b0eec7 100644 --- a/src/yuzu/CMakeLists.txt +++ b/src/yuzu/CMakeLists.txt @@ -251,7 +251,9 @@ if (YUZU_CRASH_DUMPS) breakpad.cpp breakpad.h ) + target_link_libraries(yuzu PRIVATE libbreakpad_client) + target_compile_definitions(yuzu PRIVATE YUZU_CRASH_DUMPS) endif() if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") diff --git a/src/yuzu/breakpad.cpp b/src/yuzu/breakpad.cpp index d7aed569b7..82b5deb51e 100644 --- a/src/yuzu/breakpad.cpp +++ b/src/yuzu/breakpad.cpp @@ -1,6 +1,3 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later - // SPDX-FileCopyrightText: 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -11,8 +8,6 @@ #include #elif defined(__linux__) #include -#elif defined(__sun__) -#include #else #error Minidump creation not supported on this platform #endif @@ -54,7 +49,7 @@ static void PruneDumpDirectory(const std::filesystem::path& dump_path) { } } -#ifdef __linux__ +#if defined(__linux__) [[noreturn]] bool DumpCallback(const google_breakpad::MinidumpDescriptor& descriptor, void* context, bool succeeded) { // Prevent time- and space-consuming core dumps from being generated, as we have @@ -68,7 +63,7 @@ void InstallCrashHandler() { const auto dump_path = GetEdenPath(Common::FS::EdenPath::CrashDumpsDir); PruneDumpDirectory(dump_path); -#ifdef _WIN32 +#if defined(_WIN32) // TODO: If we switch to MinGW builds for Windows, this needs to be wrapped in a C API. static google_breakpad::ExceptionHandler eh{dump_path, nullptr, nullptr, nullptr, google_breakpad::ExceptionHandler::HANDLER_ALL}; @@ -76,8 +71,6 @@ void InstallCrashHandler() { static google_breakpad::MinidumpDescriptor descriptor{dump_path}; static google_breakpad::ExceptionHandler eh{descriptor, nullptr, DumpCallback, nullptr, true, -1}; -#elif defined(__sun__) - static google_breakpad::ExceptionHandler eh{dump_path, nullptr, DumpCallback, nullptr, true}; #endif }