diff options
author | Martin Braun <martin.braun@ettus.com> | 2019-06-01 12:31:17 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2019-11-26 11:49:12 -0800 |
commit | f7cb6ee0d67afaed499cec9e8e8d0d481a65dd29 (patch) | |
tree | 20d7381f78b4f463330cb7042b36faddb95aaa60 /host/lib/utils/CMakeLists.txt | |
parent | 4bbbedbb7ea3fd8179e7f021fd9471eddd394f35 (diff) | |
download | uhd-f7cb6ee0d67afaed499cec9e8e8d0d481a65dd29.tar.gz uhd-f7cb6ee0d67afaed499cec9e8e8d0d481a65dd29.tar.bz2 uhd-f7cb6ee0d67afaed499cec9e8e8d0d481a65dd29.zip |
lib: Simplify implementation of uhd::get_system_time() to use <chrono>
uhd::get_system_time() is currently only used in USRP1 code, and it
turns out that our "optimized", platform-dependent implementation still
is a little slower than straight-up chrono. We therefore remove all the
special cases, and replace them with a single, standard solution.
Diffstat (limited to 'host/lib/utils/CMakeLists.txt')
-rw-r--r-- | host/lib/utils/CMakeLists.txt | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/host/lib/utils/CMakeLists.txt b/host/lib/utils/CMakeLists.txt index 5c4478909..4369a8f11 100644 --- a/host/lib/utils/CMakeLists.txt +++ b/host/lib/utils/CMakeLists.txt @@ -132,68 +132,6 @@ set_source_files_properties( ) ######################################################################## -# Setup defines for high resolution timing -######################################################################## -message(STATUS "") -message(STATUS "Configuring high resolution timing...") -include(CheckCXXSourceCompiles) - -set(CMAKE_REQUIRED_LIBRARIES -lrt) -CHECK_CXX_SOURCE_COMPILES(" - #include <ctime> - int main(){ - timespec ts; - return clock_gettime(CLOCK_MONOTONIC, &ts); - } - " HAVE_CLOCK_GETTIME -) -set(CMAKE_REQUIRED_LIBRARIES) - -include(CheckCXXSourceCompiles) -CHECK_CXX_SOURCE_COMPILES(" - #include <mach/mach_time.h> - int main(){ - mach_timebase_info_data_t info; - mach_timebase_info(&info); - mach_absolute_time(); - return 0; - } - " HAVE_MACH_ABSOLUTE_TIME -) - -CHECK_CXX_SOURCE_COMPILES(" - #include <Windows.h> - int main(){ - LARGE_INTEGER value; - QueryPerformanceCounter(&value); - QueryPerformanceFrequency(&value); - return 0; - } - " HAVE_QUERY_PERFORMANCE_COUNTER -) - - -if(HAVE_CLOCK_GETTIME) - message(STATUS " High resolution timing supported through clock_gettime.") - set(SYSTEM_TIME_DEFS HAVE_CLOCK_GETTIME) - LIBUHD_APPEND_LIBS("-lrt") -elseif(HAVE_MACH_ABSOLUTE_TIME) - message(STATUS " High resolution timing supported through mach_absolute_time.") - set(SYSTEM_TIME_DEFS HAVE_MACH_ABSOLUTE_TIME) -elseif(HAVE_QUERY_PERFORMANCE_COUNTER) - message(STATUS " High resolution timing supported through QueryPerformanceCounter.") - set(SYSTEM_TIME_DEFS HAVE_QUERY_PERFORMANCE_COUNTER) -else() - message(STATUS " High resolution timing supported though microsec_clock.") - set(SYSTEM_TIME_DEFS HAVE_MICROSEC_CLOCK) -endif() - -set_source_files_properties( - ${CMAKE_CURRENT_SOURCE_DIR}/system_time.cpp - PROPERTIES COMPILE_DEFINITIONS "${SYSTEM_TIME_DEFS}" -) - -######################################################################## # Setup defines for module loading ######################################################################## message(STATUS "") |