diff --git a/cmake/macros/AddCrashpad.cmake b/cmake/macros/AddCrashpad.cmake index 573e13c8a2..64c0216912 100644 --- a/cmake/macros/AddCrashpad.cmake +++ b/cmake/macros/AddCrashpad.cmake @@ -26,7 +26,6 @@ macro(add_crashpad) endif() if (WIN32 AND USE_CRASHPAD AND NOT CRASHPAD_CHECKED) - set_property(GLOBAL PROPERTY HAS_CRASHPAD TRUE) add_definitions(-DHAS_CRASHPAD) add_definitions(-DCMAKE_BACKTRACE_URL=\"${CMAKE_BACKTRACE_URL}\") add_definitions(-DCMAKE_BACKTRACE_TOKEN=\"${CMAKE_BACKTRACE_TOKEN}\") @@ -35,6 +34,21 @@ macro(add_crashpad) find_package(crashpad REQUIRED) target_include_directories(${TARGET_NAME} PRIVATE ${CRASHPAD_INCLUDE_DIRS}) target_link_libraries(${TARGET_NAME} ${CRASHPAD_LIBRARY} ${CRASHPAD_BASE_LIBRARY} ${CRASHPAD_UTIL_LIBRARY}) + + if (WIN32) + set_target_properties(${TARGET_NAME} PROPERTIES LINK_FLAGS "/ignore:4099") + endif() + + add_custom_command( + TARGET ${TARGET_NAME} + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy ${CRASHPAD_HANDLER_EXE_PATH} "$/" + ) + install( + PROGRAMS ${CRASHPAD_HANDLER_EXE_PATH} + DESTINATION ${CLIENT_COMPONENT} + COMPONENT ${INTERFACE_INSTALL_DIR} + ) set_property(GLOBAL PROPERTY CHECKED_FOR_CRASHPAD_ONCE TRUE) endif () diff --git a/cmake/macros/PackageCrashpadForDeployment.cmake b/cmake/macros/PackageCrashpadForDeployment.cmake deleted file mode 100644 index 65509c31d4..0000000000 --- a/cmake/macros/PackageCrashpadForDeployment.cmake +++ /dev/null @@ -1,32 +0,0 @@ -# -# PackageCrashpadForDeployment.cmake -# cmake/macros -# -# Copyright 2018 High Fidelity, Inc. -# Created by Clement Brisset on 01/19/18 -# -# Distributed under the Apache License, Version 2.0. -# See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html -# - -macro(PACKAGE_CRASHPAD_FOR_DEPLOYMENT) - get_property(HAS_CRASHPAD GLOBAL PROPERTY HAS_CRASHPAD) - - if (HAS_CRASHPAD) - - if (WIN32) - set_target_properties(${TARGET_NAME} PROPERTIES LINK_FLAGS "/ignore:4099") - endif() - - add_custom_command( - TARGET ${TARGET_NAME} - POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy ${CRASHPAD_HANDLER_EXE_PATH} "$/" - ) - install( - PROGRAMS ${CRASHPAD_HANDLER_EXE_PATH} - DESTINATION ${CLIENT_COMPONENT} - COMPONENT ${INTERFACE_INSTALL_DIR} - ) - endif () -endmacro() diff --git a/interface/CMakeLists.txt b/interface/CMakeLists.txt index 6cb1c352c7..db1ea6df9a 100644 --- a/interface/CMakeLists.txt +++ b/interface/CMakeLists.txt @@ -216,6 +216,7 @@ target_include_directories(${TARGET_NAME} PRIVATE "${CMAKE_BINARY_DIR}/libraries target_bullet() target_opengl() +add_crashpad() # perform standard include and linking for found externals foreach(EXTERNAL ${OPTIONAL_EXTERNALS}) @@ -347,8 +348,6 @@ if (SCRIPTS_INSTALL_DIR) ) endif() -package_crashpad_for_deployment() - if (WIN32) set(EXTRA_DEPLOY_OPTIONS "--qmldir \"${PROJECT_SOURCE_DIR}/resources/qml\"") diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 6c7093ff4d..92988267c4 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -145,6 +145,7 @@ #include "avatar/AvatarManager.h" #include "avatar/MyHead.h" #include "CrashHandler.h" +#include "Crashpad.h" #include "devices/DdeFaceTracker.h" #include "DiscoverabilityManager.h" #include "GLCanvas.h" diff --git a/interface/src/Application.h b/interface/src/Application.h index 8a19e69014..ddb8ce11e5 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -47,7 +47,6 @@ #include #include #include -#include #include diff --git a/libraries/shared/src/shared/Crashpad.cpp b/interface/src/Crashpad.cpp similarity index 100% rename from libraries/shared/src/shared/Crashpad.cpp rename to interface/src/Crashpad.cpp diff --git a/libraries/shared/src/shared/Crashpad.h b/interface/src/Crashpad.h similarity index 100% rename from libraries/shared/src/shared/Crashpad.h rename to interface/src/Crashpad.h diff --git a/interface/src/main.cpp b/interface/src/main.cpp index 94ac8b8008..fdc4f091f0 100644 --- a/interface/src/main.cpp +++ b/interface/src/main.cpp @@ -24,10 +24,10 @@ #include #include #include -#include #include "AddressManager.h" #include "Application.h" +#include "Crashpad.h" #include "InterfaceLogging.h" #include "UserActivityLogger.h" #include "MainWindow.h" diff --git a/libraries/shared/CMakeLists.txt b/libraries/shared/CMakeLists.txt index 8456838fd3..da345d1970 100644 --- a/libraries/shared/CMakeLists.txt +++ b/libraries/shared/CMakeLists.txt @@ -5,8 +5,6 @@ setup_hifi_library(Gui Network Script Widgets) if (WIN32) target_link_libraries(${TARGET_NAME} Wbemuuid.lib) - - add_crashpad() endif() target_zlib()