From b3d52e5651e210c30698bf6272f901f6de906de2 Mon Sep 17 00:00:00 2001 From: Tim Blechmann Date: Sun, 17 Dec 2023 12:10:33 +0800 Subject: [PATCH] cmake: link system libraries --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2b3f13bc..d57c44e8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,6 +27,12 @@ target_link_libraries(boost_interprocess Boost::winapi ) +if (CMAKE_SYSTEM_NAME STREQUAL "Linux") + target_link_libraries(boost_interprocess INTERFACE rt) +elseif (CMAKE_SYSTEM_NAME STREQUAL "Windows") + target_link_libraries(boost_interprocess INTERFACE ole32 oleaut32 psapi advapi32) +endif() + if(BUILD_TESTING AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/CMakeLists.txt") add_subdirectory(test)