Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@
[submodule "AuthAPI"]
path = AuthAPI
url = https://github.com/autheid/AuthAPI
[submodule "breakpad/breakpad"]
path = breakpad/breakpad
url = https://github.com/google/breakpad.git
16 changes: 16 additions & 0 deletions BlockSettleApp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ FILE(GLOB SOURCES *.cpp)
FILE(GLOB HEADERS *.h)

INCLUDE_DIRECTORIES( ${COMMON_UI_LIB_INCLUDE_DIR} )

if(WIN32)
set(SOURCES ${SOURCES} ../breakpad/qtsystemexceptionhandler.cpp)
set(HEADERS ${HEADERS} ../breakpad/qtsystemexceptionhandler.h)
endif()

INCLUDE_DIRECTORIES( ${COMMON_LIB_INCLUDE_DIR} )
INCLUDE_DIRECTORIES( ${BLOCKSETTLE_UI_INCLUDE_DIR} )
INCLUDE_DIRECTORIES( ${BS_NETWORK_INCLUDE_DIR} )
Expand All @@ -14,6 +20,7 @@ INCLUDE_DIRECTORIES( ${CRYPTO_LIB_INCLUDE_DIR} )
INCLUDE_DIRECTORIES( ${BOTAN_INCLUDE_DIR} )
INCLUDE_DIRECTORIES( ${Qt5Svg_INCLUDE_DIRS} )


IF ( APPLE )
SET( BUNDLE_NAME "BlockSettle Terminal" )

Expand Down Expand Up @@ -58,4 +65,13 @@ TARGET_LINK_LIBRARIES( ${BLOCKSETTLE_APP_NAME}
${QT_LIBS}
${OS_SPECIFIC_LIBS}
${OPENSSL_LIBS}
)

if(WIN32)
target_include_directories(${BLOCKSETTLE_APP_NAME}
PRIVATE ${CMAKE_BINARY_DIR}/common/BlockSettleUILib # for TerminalVersion.h
PRIVATE ../breakpad
)
target_compile_definitions(${BLOCKSETTLE_APP_NAME} PRIVATE -DENABLE_QT_BREAKPAD)
target_link_libraries(${BLOCKSETTLE_APP_NAME} libbreakpad)
endif()
19 changes: 19 additions & 0 deletions BlockSettleApp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@
#include "btc/ecc.h"

#include "AppNap.h"
#include "TerminalVersion.h"

#ifdef ENABLE_QT_BREAKPAD
#include "qtsystemexceptionhandler.h"
#endif

#ifdef USE_QWindowsIntegrationPlugin
Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin)
Expand Down Expand Up @@ -171,6 +176,16 @@ static int GuiApp(int &argc, char** argv)
QApplication app(argc, argv);
#endif

app.setApplicationVersion(QLatin1String(TERMINAL_VERSION_STRING));

#ifdef ENABLE_QT_BREAKPAD
// uncomment this to test the crash handler
//QTimer::singleShot(13000, []{ QtSystemExceptionHandler::crash(); });
QtSystemExceptionHandler exceptionHandler(app.applicationDirPath());
#endif

QApplication::setOrganizationName(QLatin1String("BlockSettle"));
QApplication::setApplicationName(QLatin1String("Terminal"));

QApplication::setQuitOnLastWindowClosed(false);

Expand Down Expand Up @@ -255,6 +270,7 @@ static int GuiApp(int &argc, char** argv)
splashScreen.setGeometry(splashGeometry);

splashScreen.show();

app.processEvents();

#ifdef NDEBUG
Expand All @@ -264,6 +280,9 @@ static int GuiApp(int &argc, char** argv)
#endif
}

#include <QTextStream>
#include <QFile>

int main(int argc, char** argv)
{
srand(std::time(nullptr));
Expand Down
13 changes: 13 additions & 0 deletions BlockSettleSigner/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ LIST(APPEND HEADERS ${HEADERS_QML})

FILE(GLOB RESOURCE_FILES *.qrc)

if(WIN32)
set(SOURCES ${SOURCES} ../breakpad/qtsystemexceptionhandler.cpp)
set(HEADERS ${HEADERS} ../breakpad/qtsystemexceptionhandler.h)
endif()

INCLUDE_DIRECTORIES( interfaces/GUI_QML )
INCLUDE_DIRECTORIES( ${COMMON_LIB_INCLUDE_DIR} )
Expand Down Expand Up @@ -81,3 +85,12 @@ TARGET_LINK_LIBRARIES(${SIGNER_APP_NAME}
${OS_SPECIFIC_LIBS}
${OPENSSL_LIBS}
)

if(WIN32)
target_include_directories(${SIGNER_APP_NAME}
PRIVATE ${CMAKE_BINARY_DIR}/common/BlockSettleUILib # for TerminalVersion.h
PRIVATE ../breakpad
)
target_compile_definitions(${SIGNER_APP_NAME} PRIVATE -DENABLE_QT_BREAKPAD)
target_link_libraries(${SIGNER_APP_NAME} libbreakpad)
endif()
13 changes: 13 additions & 0 deletions BlockSettleSigner/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@
#include "QmlBridge.h"

#include "AppNap.h"
#include "TerminalVersion.h"

#ifdef ENABLE_QT_BREAKPAD
#include "qtsystemexceptionhandler.h"
#endif

Q_DECLARE_METATYPE(std::string)
Q_DECLARE_METATYPE(std::vector<BinaryData>)
Expand Down Expand Up @@ -181,6 +186,14 @@ static int QMLApp(int argc, char **argv
QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QApplication app(argc, argv);

app.setApplicationVersion(QLatin1String(TERMINAL_VERSION_STRING));

#ifdef ENABLE_QT_BREAKPAD
// uncomment this to test the crash handler
//QTimer::singleShot(20000, []{ QtSystemExceptionHandler::crash(); });
QtSystemExceptionHandler exceptionHandler(app.applicationDirPath());
#endif

QApplication::setOrganizationDomain(QLatin1String("blocksettle.com"));
#ifdef __linux__
// Needed for consistency (headless now uses company name in lowercase on Linux)
Expand Down
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ endif()

option(BSTERMINAL_SHARED_LIBS "Build shared libraries" OFF)

option(ENABLE_CRASH_HANDLER "Enable the crash handler" OFF)

add_definitions(-DSTATIC_BUILD)
add_definitions(-DSPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_DEBUG)

Expand Down Expand Up @@ -798,6 +800,11 @@ ADD_SUBDIRECTORY( Celer )
ADD_SUBDIRECTORY( common/Blocksettle_proto )
ADD_SUBDIRECTORY( AuthAPI )

if(WIN32)
add_subdirectory(breakpad)
add_subdirectory(qtcrashhandler)
endif()

ADD_SUBDIRECTORY(BlockSettleApp)
ADD_SUBDIRECTORY(BlockSettleSigner)

Expand Down
35 changes: 35 additions & 0 deletions breakpad/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
cmake_minimum_required(VERSION 3.0.2)
project(libbreakpad CXX)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

add_definitions(
-DNOMINMAX
-DUNICODE
-DWIN32_LEAN_AND_MEAN
-D_CRT_SECURE_NO_WARNINGS
-D_CRT_SECURE_NO_DEPRECATE
-D_CRT_NONSTDC_NO_DEPRECATE
-D_LIBCPP_VERSION
)

file(GLOB_RECURSE LIBBREAKPAD_CLIENT_SOURCES breakpad/src/client/windows/*.cc breakpad/src/common/windows/*.cc)

include_directories("$ENV{VSINSTALLDIR}/DIA SDK/include")

file(GLOB LIBBREAKPAD_COMMON_SOURCES breakpad/src/common/*.cc breakpad/src/common/*.c breakpad/src/client/*.cc)

list(APPEND LIBBREAKPAD_CLIENT_SOURCES ${LIBBREAKPAD_COMMON_SOURCES})

list(FILTER LIBBREAKPAD_CLIENT_SOURCES EXCLUDE REGEX "/tests|/unittests|_unittest")

list(FILTER LIBBREAKPAD_CLIENT_SOURCES EXCLUDE REGEX "language.cc|path_helper.cc|stabs_to_module.cc|stabs_reader.cc|minidump_file_writer.cc")

add_library(libbreakpad ${LIBBREAKPAD_CLIENT_SOURCES})

target_link_libraries(libbreakpad PRIVATE wininet.lib)

target_include_directories(libbreakpad
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/breakpad/src
)
1 change: 1 addition & 0 deletions breakpad/breakpad
Submodule breakpad added at db1cda
Loading