mirror of
https://github.com/Lime3DS/Lime3DS.git
synced 2025-03-13 09:12:27 +01:00
Add cmake option to enable microprofile
This commit is contained in:
parent
e3a21c8ef1
commit
7062c61df9
@ -86,6 +86,8 @@ option(ENABLE_VULKAN "Enables the Vulkan renderer" ON)
|
|||||||
|
|
||||||
option(USE_DISCORD_PRESENCE "Enables Discord Rich Presence" OFF)
|
option(USE_DISCORD_PRESENCE "Enables Discord Rich Presence" OFF)
|
||||||
|
|
||||||
|
option(ENABLE_MICROPROFILE "Enables microprofile capabilities" OFF)
|
||||||
|
|
||||||
# Compile options
|
# Compile options
|
||||||
CMAKE_DEPENDENT_OPTION(COMPILE_WITH_DWARF "Add DWARF debugging information" ${IS_DEBUG_BUILD} "MINGW" OFF)
|
CMAKE_DEPENDENT_OPTION(COMPILE_WITH_DWARF "Add DWARF debugging information" ${IS_DEBUG_BUILD} "MINGW" OFF)
|
||||||
option(ENABLE_LTO "Enable link time optimization" ${DEFAULT_ENABLE_LTO})
|
option(ENABLE_LTO "Enable link time optimization" ${DEFAULT_ENABLE_LTO})
|
||||||
|
5
externals/CMakeLists.txt
vendored
5
externals/CMakeLists.txt
vendored
@ -138,6 +138,11 @@ endif()
|
|||||||
# MicroProfile
|
# MicroProfile
|
||||||
add_library(microprofile INTERFACE)
|
add_library(microprofile INTERFACE)
|
||||||
target_include_directories(microprofile SYSTEM INTERFACE ./microprofile)
|
target_include_directories(microprofile SYSTEM INTERFACE ./microprofile)
|
||||||
|
if (ENABLE_MICROPROFILE)
|
||||||
|
target_compile_definitions(microprofile INTERFACE MICROPROFILE_ENABLED=1)
|
||||||
|
else()
|
||||||
|
target_compile_definitions(microprofile INTERFACE MICROPROFILE_ENABLED=0)
|
||||||
|
endif()
|
||||||
|
|
||||||
# Nihstro
|
# Nihstro
|
||||||
add_library(nihstro-headers INTERFACE)
|
add_library(nihstro-headers INTERFACE)
|
||||||
|
@ -590,6 +590,11 @@ void GMainWindow::InitializeDebugWidgets() {
|
|||||||
microProfileDialog = new MicroProfileDialog(this);
|
microProfileDialog = new MicroProfileDialog(this);
|
||||||
microProfileDialog->hide();
|
microProfileDialog->hide();
|
||||||
debug_menu->addAction(microProfileDialog->toggleViewAction());
|
debug_menu->addAction(microProfileDialog->toggleViewAction());
|
||||||
|
#else
|
||||||
|
auto micro_profile_stub = new QAction(tr("MicroProfile (unavailable)"), this);
|
||||||
|
micro_profile_stub->setEnabled(false);
|
||||||
|
micro_profile_stub->setChecked(false);
|
||||||
|
debug_menu->addAction(micro_profile_stub);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
registersWidget = new RegistersWidget(system, this);
|
registersWidget = new RegistersWidget(system, this);
|
||||||
@ -3851,8 +3856,11 @@ static Qt::HighDpiScaleFactorRoundingPolicy GetHighDpiRoundingPolicy() {
|
|||||||
|
|
||||||
void LaunchQtFrontend(int argc, char* argv[]) {
|
void LaunchQtFrontend(int argc, char* argv[]) {
|
||||||
Common::DetachedTasks detached_tasks;
|
Common::DetachedTasks detached_tasks;
|
||||||
|
|
||||||
|
#if MICROPROFILE_ENABLED
|
||||||
MicroProfileOnThreadCreate("Frontend");
|
MicroProfileOnThreadCreate("Frontend");
|
||||||
SCOPE_EXIT({ MicroProfileShutdown(); });
|
SCOPE_EXIT({ MicroProfileShutdown(); });
|
||||||
|
#endif
|
||||||
|
|
||||||
// Init settings params
|
// Init settings params
|
||||||
QCoreApplication::setOrganizationName(QStringLiteral("Azahar Developers"));
|
QCoreApplication::setOrganizationName(QStringLiteral("Azahar Developers"));
|
||||||
|
@ -42,7 +42,9 @@ class GRenderWindow;
|
|||||||
class IPCRecorderWidget;
|
class IPCRecorderWidget;
|
||||||
class LLEServiceModulesWidget;
|
class LLEServiceModulesWidget;
|
||||||
class LoadingScreen;
|
class LoadingScreen;
|
||||||
|
#if MICROPROFILE_ENABLED
|
||||||
class MicroProfileDialog;
|
class MicroProfileDialog;
|
||||||
|
#endif
|
||||||
class MultiplayerState;
|
class MultiplayerState;
|
||||||
class ProfilerWidget;
|
class ProfilerWidget;
|
||||||
class QFileOpenEvent;
|
class QFileOpenEvent;
|
||||||
@ -383,7 +385,9 @@ private:
|
|||||||
|
|
||||||
// Debugger panes
|
// Debugger panes
|
||||||
ProfilerWidget* profilerWidget;
|
ProfilerWidget* profilerWidget;
|
||||||
|
#if MICROPROFILE_ENABLED
|
||||||
MicroProfileDialog* microProfileDialog;
|
MicroProfileDialog* microProfileDialog;
|
||||||
|
#endif
|
||||||
RegistersWidget* registersWidget;
|
RegistersWidget* registersWidget;
|
||||||
GPUCommandStreamWidget* graphicsWidget;
|
GPUCommandStreamWidget* graphicsWidget;
|
||||||
GPUCommandListWidget* graphicsCommandsWidget;
|
GPUCommandListWidget* graphicsCommandsWidget;
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
// Copyright 2015 Citra Emulator Project
|
// Copyright Citra Emulator Project / Azahar Emulator Project
|
||||||
// Licensed under GPLv2 or any later version
|
// Licensed under GPLv2 or any later version
|
||||||
// Refer to the license.txt file included.
|
// Refer to the license.txt file included.
|
||||||
|
|
||||||
|
#if MICROPROFILE_ENABLED
|
||||||
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
#include <QLayout>
|
#include <QLayout>
|
||||||
#include <QMouseEvent>
|
#include <QMouseEvent>
|
||||||
@ -15,7 +17,7 @@
|
|||||||
|
|
||||||
// Include the implementation of the UI in this file. This isn't in microprofile.cpp because the
|
// Include the implementation of the UI in this file. This isn't in microprofile.cpp because the
|
||||||
// non-Qt frontends don't need it (and don't implement the UI drawing hooks either).
|
// non-Qt frontends don't need it (and don't implement the UI drawing hooks either).
|
||||||
#if MICROPROFILE_ENABLED
|
|
||||||
#define MICROPROFILEUI_IMPL 1
|
#define MICROPROFILEUI_IMPL 1
|
||||||
#include "common/microprofileui.h"
|
#include "common/microprofileui.h"
|
||||||
|
|
||||||
@ -44,8 +46,6 @@ private:
|
|||||||
qreal x_scale = 1.0, y_scale = 1.0;
|
qreal x_scale = 1.0, y_scale = 1.0;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
MicroProfileDialog::MicroProfileDialog(QWidget* parent) : QWidget(parent, Qt::Dialog) {
|
MicroProfileDialog::MicroProfileDialog(QWidget* parent) : QWidget(parent, Qt::Dialog) {
|
||||||
setObjectName(QStringLiteral("MicroProfile"));
|
setObjectName(QStringLiteral("MicroProfile"));
|
||||||
setWindowTitle(tr("MicroProfile"));
|
setWindowTitle(tr("MicroProfile"));
|
||||||
@ -53,8 +53,6 @@ MicroProfileDialog::MicroProfileDialog(QWidget* parent) : QWidget(parent, Qt::Di
|
|||||||
// Enable the maximize button
|
// Enable the maximize button
|
||||||
setWindowFlags(windowFlags() | Qt::WindowMaximizeButtonHint);
|
setWindowFlags(windowFlags() | Qt::WindowMaximizeButtonHint);
|
||||||
|
|
||||||
#if MICROPROFILE_ENABLED
|
|
||||||
|
|
||||||
MicroProfileWidget* widget = new MicroProfileWidget(this);
|
MicroProfileWidget* widget = new MicroProfileWidget(this);
|
||||||
|
|
||||||
QLayout* layout = new QVBoxLayout(this);
|
QLayout* layout = new QVBoxLayout(this);
|
||||||
@ -67,7 +65,6 @@ MicroProfileDialog::MicroProfileDialog(QWidget* parent) : QWidget(parent, Qt::Di
|
|||||||
setFocusProxy(widget);
|
setFocusProxy(widget);
|
||||||
widget->setFocusPolicy(Qt::StrongFocus);
|
widget->setFocusPolicy(Qt::StrongFocus);
|
||||||
widget->setFocus();
|
widget->setFocus();
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QAction* MicroProfileDialog::toggleViewAction() {
|
QAction* MicroProfileDialog::toggleViewAction() {
|
||||||
@ -95,8 +92,6 @@ void MicroProfileDialog::hideEvent(QHideEvent* event) {
|
|||||||
QWidget::hideEvent(event);
|
QWidget::hideEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if MICROPROFILE_ENABLED
|
|
||||||
|
|
||||||
/// There's no way to pass a user pointer to MicroProfile, so this variable is used to make the
|
/// There's no way to pass a user pointer to MicroProfile, so this variable is used to make the
|
||||||
/// QPainter available inside the drawing callbacks.
|
/// QPainter available inside the drawing callbacks.
|
||||||
static QPainter* mp_painter = nullptr;
|
static QPainter* mp_painter = nullptr;
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
// Copyright 2015 Citra Emulator Project
|
// Copyright Citra Emulator Project / Azahar Emulator Project
|
||||||
// Licensed under GPLv2 or any later version
|
// Licensed under GPLv2 or any later version
|
||||||
// Refer to the license.txt file included.
|
// Refer to the license.txt file included.
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#if MICROPROFILE_ENABLED
|
||||||
|
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
#include "common/common_types.h"
|
#include "common/common_types.h"
|
||||||
#include "common/microprofile.h"
|
#include "common/microprofile.h"
|
||||||
@ -24,3 +26,5 @@ protected:
|
|||||||
private:
|
private:
|
||||||
QAction* toggle_view_action = nullptr;
|
QAction* toggle_view_action = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif
|
@ -1,10 +1,11 @@
|
|||||||
// Copyright 2022 Citra Emulator Project
|
// Copyright Citra Emulator Project / Azahar Emulator Project
|
||||||
// Licensed under GPLv2 or any later version
|
// Licensed under GPLv2 or any later version
|
||||||
// Refer to the license.txt file included.
|
// Refer to the license.txt file included.
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <span>
|
#include <span>
|
||||||
|
#include <string_view>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <glad/glad.h>
|
#include <glad/glad.h>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user