Skip to content

Commit acdc98e

Browse files
committed
Changes to compile on windows and use with DynCam
1 parent dc9f137 commit acdc98e

3 files changed

Lines changed: 12 additions & 34 deletions

File tree

‎CMakeLists.txt‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,18 @@ cmake_minimum_required (VERSION 2.6)
33
enable_testing()
44

55
project (CppReact)
6-
6+
find_package(TBB REQUIRED tbb)
77
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
88
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
99
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
10-
11-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -Wall -Wpedantic")
10+
set (CMAKE_CXX_STANDARD 14)
11+
if (NOT WIN32)
12+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -Wall -Wpedantic")
13+
endif ()
1214

1315
include_directories (SYSTEM "${PROJECT_SOURCE_DIR}/include")
14-
16+
#TODO send diff
17+
include_directories("${TBB_DIR}/../include")
1518
### CppReact
1619
file(GLOB_RECURSE CPPREACT_HEADERS include/*.h)
1720

@@ -23,8 +26,7 @@ add_library(CppReact
2326
src/logging/EventRecords.cpp
2427
${CPPREACT_HEADERS})
2528

26-
target_link_libraries(CppReact tbb)
27-
29+
target_link_libraries(CppReact "${TBB_DIR}/../lib/intel64/vc14/tbb_debug.lib")
2830
### examples/
2931
option(build_examples "Build examples?" ON)
3032
if(build_examples)

‎include/react/common/Timing.h‎

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -13,39 +13,15 @@
1313

1414
#include <utility>
1515

16-
#if _WIN32 || _WIN64
17-
#define REACT_FIXME_CUSTOM_TIMER 1
18-
#else
19-
#define REACT_FIXME_CUSTOM_TIMER 0
20-
#endif
16+
#include <chrono>
2117

22-
#if REACT_FIXME_CUSTOM_TIMER
23-
#include <windows.h>
24-
#else
25-
#include <chrono>
26-
#endif
2718

2819
/***************************************/ REACT_IMPL_BEGIN /**************************************/
2920

3021
///////////////////////////////////////////////////////////////////////////////////////////////////
3122
/// GetPerformanceFrequency
3223
///////////////////////////////////////////////////////////////////////////////////////////////////
3324
// Todo: Initialization not thread-safe
34-
#if REACT_FIXME_CUSTOM_TIMER
35-
inline const LARGE_INTEGER& GetPerformanceFrequency()
36-
{
37-
static bool init = false;
38-
static LARGE_INTEGER frequency;
39-
40-
if (init == false)
41-
{
42-
QueryPerformanceFrequency(&frequency);
43-
init = true;
44-
}
45-
46-
return frequency;
47-
}
48-
#endif
4925

5026
///////////////////////////////////////////////////////////////////////////////////////////////////
5127
/// ConditionalTimer

‎src/logging/EventLog.cpp‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ using std::chrono::microseconds;
1515
/// EventLog
1616
///////////////////////////////////////////////////////////////////////////////////////////////////
1717
EventLog::Entry::Entry() :
18-
time_{ std::chrono::system_clock::now() },
18+
time_{ std::chrono::steady_clock::now() },
1919
data_{ nullptr }
2020
{
2121
}
@@ -27,7 +27,7 @@ EventLog::Entry::Entry(const Entry& other) :
2727
}
2828

2929
EventLog::Entry::Entry(IEventRecord* ptr) :
30-
time_{ std::chrono::system_clock::now() },
30+
time_{ std::chrono::steady_clock::now() },
3131
data_{ ptr }
3232
{
3333
}
@@ -54,7 +54,7 @@ bool EventLog::Entry::Equals(const Entry& other) const
5454
}
5555

5656
EventLog::EventLog() :
57-
startTime_(std::chrono::system_clock::now())
57+
startTime_(std::chrono::steady_clock::now())
5858
{
5959
}
6060

0 commit comments

Comments
 (0)