From 08e3ea78eae610bec02be2e79ececfe8ef895560 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Sun, 21 Oct 2018 20:25:55 +0100 Subject: [PATCH] cmake: rdtsc is only supported on x86 --- common/lib/CMakeLists.txt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/common/lib/CMakeLists.txt b/common/lib/CMakeLists.txt index 7381b70c4..d343cc657 100644 --- a/common/lib/CMakeLists.txt +++ b/common/lib/CMakeLists.txt @@ -39,7 +39,6 @@ add_library(villas-common SHARED memory_manager.cpp plugin.cpp table.c - tsc.c task.c timing.c utils.c @@ -49,6 +48,16 @@ add_library(villas-common SHARED version.cpp ) +execute_process( + COMMAND uname -m + COMMAND tr -d '\n' + OUTPUT_VARIABLE ARCH +) + +if(ARCH STREQUAL "x86_64") + target_sources(villas-common PRIVATE tsc.c) +endif() + if(CMAKE_SYSTEM_NAME STREQUAL Linux) target_sources(villas-common PRIVATE kernel/pci.c