Add qml debugging option

This commit is contained in:
Nicolas Werner 2019-12-14 23:48:02 +01:00
parent 935727864a
commit 7d6a015f36
3 changed files with 10 additions and 1 deletions

View file

@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 3.11)
option(APPVEYOR_BUILD "Build on appveyor" OFF) option(APPVEYOR_BUILD "Build on appveyor" OFF)
option(ASAN "Compile with address sanitizers" OFF) option(ASAN "Compile with address sanitizers" OFF)
option(QML_DEBUGGING "Enable qml debugging" OFF)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
@ -450,6 +451,10 @@ else()
target_link_libraries (nheko ${NHEKO_LIBS} Qt5::DBus) target_link_libraries (nheko ${NHEKO_LIBS} Qt5::DBus)
endif() endif()
if(QML_DEBUGGING)
target_compile_definitions(nheko PRIVATE QML_DEBUGGING)
endif()
if(EXTERNAL_PROJECT_DEPS) if(EXTERNAL_PROJECT_DEPS)
add_dependencies(nheko ${EXTERNAL_PROJECT_DEPS}) add_dependencies(nheko ${EXTERNAL_PROJECT_DEPS})
endif() endif()

View file

@ -53,4 +53,3 @@ private:
std::map<QString, QSharedPointer<CommunitiesListItem>> communities_; std::map<QString, QSharedPointer<CommunitiesListItem>> communities_;
}; };

View file

@ -47,6 +47,11 @@
#include <boost/stacktrace.hpp> #include <boost/stacktrace.hpp>
#include <signal.h> #include <signal.h>
#ifdef QML_DEBUGGING
#include <QQmlDebuggingEnabler>
QQmlDebuggingEnabler enabler;
#endif
void void
stacktraceHandler(int signum) stacktraceHandler(int signum)
{ {