mirror of
https://github.com/rizinorg/cutter.git
synced 2024-12-18 10:56:11 +00:00
Don't compile files for features that are disabled. (#2561)
Don't wrap whole cpp file in ifdef, it confuses clang-format.
This commit is contained in:
parent
562979bcff
commit
18e98e7868
@ -64,7 +64,6 @@ set(SOURCES
|
||||
widgets/HeadersWidget.cpp
|
||||
widgets/SearchWidget.cpp
|
||||
CutterApplication.cpp
|
||||
common/PythonAPI.cpp
|
||||
dialogs/RizinPluginsDialog.cpp
|
||||
widgets/CutterDockWidget.cpp
|
||||
widgets/CutterTreeWidget.cpp
|
||||
@ -100,7 +99,6 @@ set(SOURCES
|
||||
widgets/CutterTreeView.cpp
|
||||
widgets/ComboQuickFilterView.cpp
|
||||
dialogs/HexdumpRangeDialog.cpp
|
||||
common/QtResImporter.cpp
|
||||
common/CutterSeekable.cpp
|
||||
common/RefreshDeferrer.cpp
|
||||
dialogs/WelcomeDialog.cpp
|
||||
@ -108,7 +106,6 @@ set(SOURCES
|
||||
dialogs/EditMethodDialog.cpp
|
||||
dialogs/TypesInteractionDialog.cpp
|
||||
widgets/SdbWidget.cpp
|
||||
common/PythonManager.cpp
|
||||
plugins/PluginManager.cpp
|
||||
common/BasicBlockHighlighter.cpp
|
||||
common/BasicInstructionHighlighter.cpp
|
||||
@ -120,7 +117,6 @@ set(SOURCES
|
||||
dialogs/preferences/ColorThemeEditDialog.cpp
|
||||
common/UpdateWorker.cpp
|
||||
widgets/MemoryDockWidget.cpp
|
||||
common/CrashHandler.cpp
|
||||
common/BugReporting.cpp
|
||||
common/HighDpiPixmap.cpp
|
||||
widgets/GraphGridLayout.cpp
|
||||
@ -211,7 +207,6 @@ set(HEADER_FILES
|
||||
widgets/TypesWidget.h
|
||||
widgets/HeadersWidget.h
|
||||
widgets/SearchWidget.h
|
||||
common/PythonAPI.h
|
||||
dialogs/RizinPluginsDialog.h
|
||||
widgets/CutterDockWidget.h
|
||||
widgets/CutterTreeWidget.h
|
||||
@ -251,7 +246,6 @@ set(HEADER_FILES
|
||||
widgets/CutterTreeView.h
|
||||
widgets/ComboQuickFilterView.h
|
||||
dialogs/HexdumpRangeDialog.h
|
||||
common/QtResImporter.h
|
||||
common/CutterSeekable.h
|
||||
common/RefreshDeferrer.h
|
||||
dialogs/WelcomeDialog.h
|
||||
@ -261,7 +255,6 @@ set(HEADER_FILES
|
||||
common/CrashHandler.h
|
||||
dialogs/TypesInteractionDialog.h
|
||||
widgets/SdbWidget.h
|
||||
common/PythonManager.h
|
||||
plugins/PluginManager.h
|
||||
common/BasicBlockHighlighter.h
|
||||
common/BasicInstructionHighlighter.h
|
||||
@ -376,6 +369,15 @@ set(QRC_FILES
|
||||
themes/lightstyle/light.qrc
|
||||
)
|
||||
|
||||
if (CUTTER_ENABLE_PYTHON)
|
||||
list(APPEND SOURCES common/QtResImporter.cpp common/PythonManager.cpp common/PythonAPI.cpp)
|
||||
list(APPEND HEADER_FILES common/QtResImporter.h common/PythonManager.h common/PythonAPI.h)
|
||||
endif()
|
||||
|
||||
if(CUTTER_ENABLE_CRASH_REPORTS)
|
||||
list(APPEND SOURCES common/CrashHandler.cpp)
|
||||
endif()
|
||||
|
||||
if(CUTTER_ENABLE_PYTHON_BINDINGS)
|
||||
set(BINDINGS_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/bindings")
|
||||
set(BINDINGS_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/bindings")
|
||||
|
@ -54,6 +54,7 @@ static void connectToConsole()
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
#ifdef CUTTER_ENABLE_CRASH_REPORTS
|
||||
if (argc >= 3 && QString::fromLocal8Bit(argv[1]) == "--start-crash-handler") {
|
||||
QApplication app(argc, argv);
|
||||
QString dumpLocation = QString::fromLocal8Bit(argv[2]);
|
||||
@ -62,6 +63,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
initCrashHandler();
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
connectToConsole();
|
||||
|
@ -7,8 +7,6 @@
|
||||
#include <QStandardPaths>
|
||||
#include <QTime>
|
||||
|
||||
#ifdef CUTTER_ENABLE_CRASH_REPORTS
|
||||
|
||||
#include <QApplication>
|
||||
#include <QString>
|
||||
#include <QFile>
|
||||
@ -106,16 +104,6 @@ void initCrashHandler()
|
||||
atexit(finishCrashHandler);
|
||||
}
|
||||
|
||||
#else // CUTTER_ENABLE_CRASH_REPORTS
|
||||
|
||||
void initCrashHandler()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#endif // CUTTER_ENABLE_CRASH_REPORTS
|
||||
|
||||
|
||||
void showCrashDialog(const QString &dumpFile)
|
||||
{
|
||||
QMessageBox mb;
|
||||
|
@ -1,6 +1,3 @@
|
||||
|
||||
#ifdef CUTTER_ENABLE_PYTHON
|
||||
|
||||
#include "PythonAPI.h"
|
||||
#include "core/Cutter.h"
|
||||
|
||||
@ -83,5 +80,3 @@ PyObject *PyInit_api()
|
||||
{
|
||||
return PyModule_Create(&CutterModule);
|
||||
}
|
||||
|
||||
#endif // CUTTER_ENABLE_PYTHON
|
||||
|
@ -1,13 +1,9 @@
|
||||
#ifndef PYTHONAPI_H
|
||||
#define PYTHONAPI_H
|
||||
|
||||
#ifdef CUTTER_ENABLE_PYTHON
|
||||
|
||||
#define Py_LIMITED_API 0x03050000
|
||||
#include <Python.h>
|
||||
|
||||
PyObject *PyInit_api();
|
||||
|
||||
#endif
|
||||
|
||||
#endif // PYTHONAPI_H
|
||||
|
@ -1,5 +1,3 @@
|
||||
#ifdef CUTTER_ENABLE_PYTHON
|
||||
|
||||
#include <cassert>
|
||||
|
||||
#include "PythonAPI.h"
|
||||
@ -184,5 +182,3 @@ void PythonManager::saveThread()
|
||||
pyThreadState = PyEval_SaveThread();
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -1,8 +1,4 @@
|
||||
#ifdef CUTTER_ENABLE_PYTHON
|
||||
|
||||
#define Py_LIMITED_API 0x03050000
|
||||
#include <Python.h>
|
||||
|
||||
#include "PythonAPI.h"
|
||||
#include "QtResImporter.h"
|
||||
|
||||
#include <QFile>
|
||||
@ -87,5 +83,3 @@ PyObject *PyInit_qtres()
|
||||
{
|
||||
return PyModule_Create(&QtResModule);
|
||||
}
|
||||
|
||||
#endif // CUTTER_ENABLE_PYTHON
|
||||
|
@ -1,14 +1,10 @@
|
||||
#ifndef QTRESIMPORTER_H
|
||||
#define QTRESIMPORTER_H
|
||||
|
||||
#ifdef CUTTER_ENABLE_PYTHON
|
||||
|
||||
PyObject *PyInit_qtres();
|
||||
|
||||
PyObject *QtResImport(const char *name);
|
||||
|
||||
#define RegQtResImporter() Py_DecRef(QtResImport("reg_qtres_importer"))
|
||||
|
||||
#endif // CUTTER_ENABLE_PYTHON
|
||||
|
||||
#endif // QTRESIMPORTER_H
|
||||
|
@ -19,8 +19,9 @@
|
||||
#include <QMessageBox>
|
||||
#include "common/Configuration.h"
|
||||
#include "CutterConfig.h"
|
||||
#endif
|
||||
|
||||
|
||||
#if CUTTER_UPDATE_WORKER_AVAILABLE
|
||||
UpdateWorker::UpdateWorker(QObject *parent) :
|
||||
QObject(parent), pending(false)
|
||||
{
|
||||
|
@ -10,14 +10,15 @@
|
||||
#endif
|
||||
|
||||
#if CUTTER_UPDATE_WORKER_AVAILABLE
|
||||
|
||||
#include <QDir>
|
||||
#include <QTimer>
|
||||
#include <QObject>
|
||||
#include <QtNetwork/QNetworkAccessManager>
|
||||
|
||||
#include <QVersionNumber>
|
||||
#endif
|
||||
|
||||
#if CUTTER_UPDATE_WORKER_AVAILABLE
|
||||
class QNetworkReply;
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user