diff --git a/CMakeLists.txt b/CMakeLists.txt index 15bf3d5c..1f970330 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,15 +3,18 @@ cmake_minimum_required (VERSION 2.6) enable_testing() project (CppReact) - +find_package(TBB REQUIRED tbb) set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) - -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -Wall -Wpedantic") - -include_directories ("${PROJECT_SOURCE_DIR}/include") - +set (CMAKE_CXX_STANDARD 14) +if (NOT WIN32) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -Wall -Wpedantic") +endif () + +include_directories (SYSTEM "${PROJECT_SOURCE_DIR}/include") +#TODO send diff +include_directories("${TBB_DIR}/../include") ### CppReact file(GLOB_RECURSE CPPREACT_HEADERS include/*.h) @@ -23,8 +26,7 @@ add_library(CppReact src/logging/EventRecords.cpp ${CPPREACT_HEADERS}) -target_link_libraries(CppReact tbb) - +target_link_libraries(CppReact "${TBB_DIR}/../lib/intel64/vc14/tbb_debug.lib") ### examples/ option(build_examples "Build examples?" ON) if(build_examples) diff --git a/include/react/common/Timing.h b/include/react/common/Timing.h index 9440ceaa..2c7e92fc 100644 --- a/include/react/common/Timing.h +++ b/include/react/common/Timing.h @@ -13,17 +13,8 @@ #include -#if _WIN32 || _WIN64 - #define REACT_FIXME_CUSTOM_TIMER 1 -#else - #define REACT_FIXME_CUSTOM_TIMER 0 -#endif +#include -#if REACT_FIXME_CUSTOM_TIMER - #include -#else - #include -#endif /***************************************/ REACT_IMPL_BEGIN /**************************************/ @@ -31,21 +22,6 @@ /// GetPerformanceFrequency /////////////////////////////////////////////////////////////////////////////////////////////////// // Todo: Initialization not thread-safe -#if REACT_FIXME_CUSTOM_TIMER -inline const LARGE_INTEGER& GetPerformanceFrequency() -{ - static bool init = false; - static LARGE_INTEGER frequency; - - if (init == false) - { - QueryPerformanceFrequency(&frequency); - init = true; - } - - return frequency; -} -#endif /////////////////////////////////////////////////////////////////////////////////////////////////// /// ConditionalTimer diff --git a/src/logging/EventLog.cpp b/src/logging/EventLog.cpp index a22601e5..dba36513 100644 --- a/src/logging/EventLog.cpp +++ b/src/logging/EventLog.cpp @@ -15,7 +15,7 @@ using std::chrono::microseconds; /// EventLog /////////////////////////////////////////////////////////////////////////////////////////////////// EventLog::Entry::Entry() : - time_{ std::chrono::system_clock::now() }, + time_{ std::chrono::steady_clock::now() }, data_{ nullptr } { } @@ -27,7 +27,7 @@ EventLog::Entry::Entry(const Entry& other) : } EventLog::Entry::Entry(IEventRecord* ptr) : - time_{ std::chrono::system_clock::now() }, + time_{ std::chrono::steady_clock::now() }, data_{ ptr } { } @@ -54,7 +54,7 @@ bool EventLog::Entry::Equals(const Entry& other) const } EventLog::EventLog() : - startTime_(std::chrono::system_clock::now()) + startTime_(std::chrono::steady_clock::now()) { }