From 5859364ad14069509650e9c7b0b39aa5a3883898 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Wed, 1 Jul 2020 14:36:18 +0200 Subject: [PATCH] cmake: add rt lib to interface libraries --- lib/CMakeLists.txt | 7 ++++++- lib/nodes/CMakeLists.txt | 4 ---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index c7fdecbe8..3fc9fbdc2 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -36,8 +36,13 @@ set(LIBRARIES stdc++ ) +# For shmem_unlink +if(UNIX AND NOT APPLE) + list(APPEND LIBRARIES "rt") +endif() + if(CMAKE_CXX_COMPILER_ID STREQUAL GNU) - list(APPEND LIBRARIES "-lstdc++fs") + list(APPEND LIBRARIES "-lstdc++fs") endif() set(LIB_SRC diff --git a/lib/nodes/CMakeLists.txt b/lib/nodes/CMakeLists.txt index ab17ad430..4c2d4050b 100644 --- a/lib/nodes/CMakeLists.txt +++ b/lib/nodes/CMakeLists.txt @@ -69,10 +69,6 @@ endif() # Enable shared memory node-type if(WITH_NODE_SHMEM) list(APPEND NODE_SRC shmem.cpp) - - if(CMAKE_SUSTEM_NAME STREQUAL Linux) - list(APPEND LIBRARIES rt) - endif() endif() # Enable IEC61850 node-types when libiec61850 is available