mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 17:05:44 +01:00
Core/Misc: Add PERFORMANCE_PROFILING CMake option
Add a new CMake option called PERFORMANCE_PROFILING that should be used only when profiling the performance. This option is unsupported, do not report any issue happening when enabling this option.
This commit is contained in:
@@ -105,6 +105,13 @@ if ( HELGRIND )
|
||||
add_definitions(-DHELGRIND)
|
||||
endif()
|
||||
|
||||
if ( PERFORMANCE_PROFILING )
|
||||
message("")
|
||||
message(" *** PERFORMANCE_PROFILING - WARNING!")
|
||||
message(" *** Please note that this is for PERFORMANCE PROFILING only! Do NOT report any issue when enabling this configuration!")
|
||||
add_definitions(-DPERFORMANCE_PROFILING)
|
||||
endif()
|
||||
|
||||
if (BUILD_SHARED_LIBS)
|
||||
message("")
|
||||
message(" *** WITH_DYNAMIC_LINKING - INFO!")
|
||||
|
||||
@@ -52,7 +52,12 @@ namespace Trinity
|
||||
#define WPWarning(cond, msg) ASSERT_BEGIN do { if (!(cond)) Trinity::Warning(__FILE__, __LINE__, __FUNCTION__, (msg)); } while(0) ASSERT_END
|
||||
#define WPAbort() ASSERT_BEGIN do { Trinity::Abort(__FILE__, __LINE__, __FUNCTION__); } while(0) ASSERT_END
|
||||
|
||||
#ifdef PERFORMANCE_PROFILING
|
||||
#define ASSERT(cond, ...) ((void)0)
|
||||
#else
|
||||
#define ASSERT WPAssert
|
||||
#endif
|
||||
|
||||
#define ABORT WPAbort
|
||||
|
||||
template <typename T> inline T* ASSERT_NOTNULL(T* pointer)
|
||||
|
||||
@@ -144,7 +144,9 @@ class TC_COMMON_API Log
|
||||
} \
|
||||
}
|
||||
|
||||
#if TRINITY_PLATFORM != TRINITY_PLATFORM_WINDOWS
|
||||
#ifdef PERFORMANCE_PROFILING
|
||||
#define TC_LOG_MESSAGE_BODY(filterType__, level__, ...) ((void)0)
|
||||
#elif TRINITY_PLATFORM != TRINITY_PLATFORM_WINDOWS
|
||||
void check_args(char const*, ...) ATTR_PRINTF(1, 2);
|
||||
void check_args(std::string const&, ...);
|
||||
|
||||
|
||||
@@ -121,7 +121,10 @@ public:
|
||||
|
||||
#define sMetric Metric::instance()
|
||||
|
||||
#if TRINITY_PLATFORM != TRINITY_PLATFORM_WINDOWS
|
||||
#ifdef PERFORMANCE_PROFILING
|
||||
#define TC_METRIC_EVENT(category, title, description) ((void)0)
|
||||
#define TC_METRIC_VALUE(category, value) ((void)0)
|
||||
#elif TRINITY_PLATFORM != TRINITY_PLATFORM_WINDOWS
|
||||
#define TC_METRIC_EVENT(category, title, description) \
|
||||
do { \
|
||||
if (sMetric->IsEnabled()) \
|
||||
|
||||
Reference in New Issue
Block a user