diff --git a/include/profiler/profiler.h b/include/profiler/profiler.h index 11522c8..554da6e 100644 --- a/include/profiler/profiler.h +++ b/include/profiler/profiler.h @@ -33,7 +33,7 @@ namespace profiler { const uint32_t EASY_FULL_VERSION = ((uint32_t)EASY_VERSION_MAJOR << 24) | ((uint32_t)EASY_VERSION_MINOR << 16) | (uint32_t)EASY_VERSION_REV; } -#ifndef FULL_DISABLE_PROFILER +#ifdef BUILD_WITH_EASY_PROFILER /** \defgroup profiler EasyProfiler @@ -275,7 +275,7 @@ Otherwise, no log messages will be printed. # define EASY_LOG_ENABLED 1 -#else // #ifndef FULL_DISABLE_PROFILER +#else // #ifdef BUILD_WITH_EASY_PROFILER # define EASY_BLOCK(...) # define EASY_FUNCTION(...) @@ -299,7 +299,7 @@ Otherwise, no log messages will be printed. # define EASY_LOW_PRIORITY_EVENT_TRACING true # define EASY_LOG_ENABLED 0 -#endif // #ifndef FULL_DISABLE_PROFILER +#endif // #ifndef BUILD_WITH_EASY_PROFILER ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// diff --git a/include/profiler/profiler_aux.h b/include/profiler/profiler_aux.h index 376251a..117959d 100644 --- a/include/profiler/profiler_aux.h +++ b/include/profiler/profiler_aux.h @@ -48,18 +48,16 @@ namespace profiler { FORCE_ON_WITHOUT_CHILDREN = FORCE_ON | OFF_RECURSIVE, ///< The block is ALWAYS ON but all of it's children are OFF. }; - struct passthrough_hash EASY_FINAL { - template inline size_t operator () (T _value) const { - return static_cast(_value); - } + struct passthrough_hash EASY_FINAL { + template inline size_t operator () (T _value) const { + return static_cast(_value); + } }; } ////////////////////////////////////////////////////////////////////////// -#ifndef FULL_DISABLE_PROFILER - #include # define EASY_STRINGIFY(a) #a @@ -69,6 +67,8 @@ namespace profiler { # define EASY_UNIQUE_BLOCK(x) EASY_TOKEN_CONCATENATE(unique_profiler_mark_name_, x) # define EASY_UNIQUE_DESC(x) EASY_TOKEN_CONCATENATE(unique_profiler_descriptor_, x) +#ifdef BUILD_WITH_EASY_PROFILER + namespace profiler { template struct NameSwitch EASY_FINAL { @@ -138,7 +138,7 @@ namespace profiler { # define EASY_COMPILETIME_NAME(name) ::profiler::NameSwitch<::std::is_reference::value>::compiletime_name(name, EASY_UNIQUE_LINE_ID) # define EASY_RUNTIME_NAME(name) ::profiler::NameSwitch<::std::is_reference::value>::runtime_name(name) -#endif // FULL_DISABLE_PROFILER +#endif // BUILD_WITH_EASY_PROFILER ////////////////////////////////////////////////////////////////////////// diff --git a/sample/CMakeLists.txt b/sample/CMakeLists.txt index 7106410..1686389 100644 --- a/sample/CMakeLists.txt +++ b/sample/CMakeLists.txt @@ -22,4 +22,4 @@ endif(UNIX) target_link_libraries(${PROJECT_NAME} easy_profiler ${SPEC_LIB}) target_link_libraries(${DISABLED_PROFILER_NAME} easy_profiler ${SPEC_LIB}) -target_compile_definitions(${DISABLED_PROFILER_NAME} PRIVATE FULL_DISABLE_PROFILER) +target_compile_definitions(${PROJECT_NAME} PRIVATE BUILD_WITH_EASY_PROFILER) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 87be249..90cc2e1 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -25,6 +25,7 @@ set(SOURCES ) add_definitions( -D_BUILD_PROFILER + -DBUILD_WITH_EASY_PROFILER ) if(WIN32)