[APP] Allow profiler to be enabled via cmake option
- Hide profiler buttons if profiler is disabled - From default it is disabled
This commit is contained in:
@@ -37,6 +37,10 @@ message(STATUS "Target architecture: XE_TARGET_AARCH64=${XE_TARGET_AARCH64} XE_T
|
|||||||
option(XENIA_BUILD_TESTS "Build test suites" OFF)
|
option(XENIA_BUILD_TESTS "Build test suites" OFF)
|
||||||
option(XENIA_BUILD_MISC "Build misc subprojects (trace viewers, shader compiler, vfs-dump, demos)" OFF)
|
option(XENIA_BUILD_MISC "Build misc subprojects (trace viewers, shader compiler, vfs-dump, demos)" OFF)
|
||||||
|
|
||||||
|
# Toggle profiler
|
||||||
|
add_compile_definitions(XE_OPTION_PROFILING=1)
|
||||||
|
add_compile_definitions(XE_OPTION_PROFILING_UI=1)
|
||||||
|
|
||||||
if(XENIA_BUILD_TESTS)
|
if(XENIA_BUILD_TESTS)
|
||||||
enable_testing()
|
enable_testing()
|
||||||
include(${PROJECT_SOURCE_DIR}/third_party/catch/contrib/Catch.cmake)
|
include(${PROJECT_SOURCE_DIR}/third_party/catch/contrib/Catch.cmake)
|
||||||
|
|||||||
@@ -805,6 +805,7 @@ bool EmulatorWindow::Initialize() {
|
|||||||
MenuItem::Type::kString, "Time Scalar *= 2", "Numpad +",
|
MenuItem::Type::kString, "Time Scalar *= 2", "Numpad +",
|
||||||
std::bind(&EmulatorWindow::CpuTimeScalarSetDouble, this)));
|
std::bind(&EmulatorWindow::CpuTimeScalarSetDouble, this)));
|
||||||
}
|
}
|
||||||
|
#if XE_OPTION_PROFILING
|
||||||
cpu_menu->AddChild(MenuItem::Create(MenuItem::Type::kSeparator));
|
cpu_menu->AddChild(MenuItem::Create(MenuItem::Type::kSeparator));
|
||||||
{
|
{
|
||||||
cpu_menu->AddChild(MenuItem::Create(MenuItem::Type::kString,
|
cpu_menu->AddChild(MenuItem::Create(MenuItem::Type::kString,
|
||||||
@@ -814,6 +815,7 @@ bool EmulatorWindow::Initialize() {
|
|||||||
"&Pause/Resume Profiler", "`",
|
"&Pause/Resume Profiler", "`",
|
||||||
[]() { Profiler::TogglePause(); }));
|
[]() { Profiler::TogglePause(); }));
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
cpu_menu->AddChild(MenuItem::Create(MenuItem::Type::kSeparator));
|
cpu_menu->AddChild(MenuItem::Create(MenuItem::Type::kSeparator));
|
||||||
{
|
{
|
||||||
cpu_menu->AddChild(MenuItem::Create(
|
cpu_menu->AddChild(MenuItem::Create(
|
||||||
|
|||||||
@@ -20,12 +20,13 @@
|
|||||||
#include "xenia/ui/virtual_key.h"
|
#include "xenia/ui/virtual_key.h"
|
||||||
#include "xenia/ui/window_listener.h"
|
#include "xenia/ui/window_listener.h"
|
||||||
|
|
||||||
#if XE_PLATFORM_WIN32 && 0
|
#ifndef XE_OPTION_PROFILING
|
||||||
#define XE_OPTION_PROFILING 1
|
|
||||||
#define XE_OPTION_PROFILING_UI 1
|
|
||||||
#else
|
|
||||||
#define XE_OPTION_PROFILING 0
|
#define XE_OPTION_PROFILING 0
|
||||||
#endif // XE_PLATFORM_WIN32
|
#endif
|
||||||
|
|
||||||
|
#ifndef XE_OPTION_PROFILING_UI
|
||||||
|
#define XE_OPTION_PROFILING_UI 0
|
||||||
|
#endif
|
||||||
|
|
||||||
#if XE_OPTION_PROFILING
|
#if XE_OPTION_PROFILING
|
||||||
// Pollutes the global namespace. Yuck.
|
// Pollutes the global namespace. Yuck.
|
||||||
|
|||||||
Reference in New Issue
Block a user