aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2015-03-12 18:03:33 -0400
committerEric Fiselier <eric@efcs.ca>2015-03-12 18:03:33 -0400
commit7a767012f1c423b37069f6d315b97164b5850271 (patch)
tree5591b5beb28bb057f4320bae13e1bacff4074073 /CMakeLists.txt
parent7c6a7e30845f1fb328235e5efd02c078b40f09e8 (diff)
downloadgoogle-benchmark-7a767012f1c423b37069f6d315b97164b5850271.tar.gz
Adopt new benchmark timing internals.
This patch adopts a new internal structure for how timings are performed. Currently every iteration of a benchmark checks to see if it has been running for an appropriate amount of time. Checking the clock introduces noise into the timings and this can cause inconsistent output from each benchmark. Now every iteration of a benchmark only checks an iteration count to see if it should stop running. The iteration count is determined before hand by testing the benchmark on a series of increasing iteration counts until a suitable count is found. This increases the amount of time it takes to run the actual benchmarks but it also greatly increases the accuracy of the results. This patch introduces some breaking changes. The notable breaking changes are: 1. Benchmarks run on multiple threads no generate a report per thread. Instead only a single report is generated. 2. ::benchmark::UseRealTime() was removed and replaced with State::UseRealTime().
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt4
1 files changed, 4 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2526faf..4296b23 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -44,6 +44,10 @@ add_cxx_compiler_flag(-pedantic-errors)
add_cxx_compiler_flag(-fno-strict-aliasing RELEASE)
add_cxx_compiler_flag(-Wthread-safety)
+if (HAVE_WTHREAD_SAFETY)
+ add_definitions(-DHAVE_WTHREAD_SAFETY)
+ cxx_feature_check(THREAD_SAFETY_ATTRIBUTES)
+endif()
# C++ feature checks
cxx_feature_check(STD_REGEX)