diff --git a/src/cpp-utils/CMakeLists.txt b/src/cpp-utils/CMakeLists.txt index b66ba46d..3fb68b02 100644 --- a/src/cpp-utils/CMakeLists.txt +++ b/src/cpp-utils/CMakeLists.txt @@ -35,11 +35,6 @@ set(SOURCES add_library(${PROJECT_NAME} STATIC ${SOURCES}) -# This is needed by boost thread -if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") - target_link_libraries(${PROJECT_NAME} PUBLIC rt) -endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux") - target_link_libraries(${PROJECT_NAME} PUBLIC pthread curl) # TODO From Crypto++ 5.7 on, it should support cmake with find_package() instead of find_library(). diff --git a/test/blockstore/implementations/testfake/TestFakeBlockStoreTest.cpp b/test/blockstore/implementations/testfake/TestFakeBlockStoreTest.cpp index 09bd86e1..28c568f0 100644 --- a/test/blockstore/implementations/testfake/TestFakeBlockStoreTest.cpp +++ b/test/blockstore/implementations/testfake/TestFakeBlockStoreTest.cpp @@ -3,7 +3,7 @@ #include "../../testutils/BlockStoreTest.h" #include "../../testutils/BlockStoreWithRandomKeysTest.h" #include - +#include using blockstore::BlockStore; using blockstore::BlockStoreWithRandomKeys; diff --git a/test/cpp-utils/CMakeLists.txt b/test/cpp-utils/CMakeLists.txt index cc799a9c..dc132db6 100644 --- a/test/cpp-utils/CMakeLists.txt +++ b/test/cpp-utils/CMakeLists.txt @@ -53,10 +53,5 @@ add_executable(${PROJECT_NAME} ${SOURCES}) target_link_libraries(${PROJECT_NAME} googletest cpp-utils) add_test(${PROJECT_NAME} ${PROJECT_NAME}) -# This is needed by boost thread -if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") - target_link_libraries(${PROJECT_NAME} PUBLIC rt) -endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux") - target_enable_style_warnings(${PROJECT_NAME}) target_activate_cpp14(${PROJECT_NAME}) diff --git a/test/fspp/CMakeLists.txt b/test/fspp/CMakeLists.txt index 7eaed7d9..3df535d7 100644 --- a/test/fspp/CMakeLists.txt +++ b/test/fspp/CMakeLists.txt @@ -106,10 +106,5 @@ add_executable(${PROJECT_NAME} ${SOURCES}) target_link_libraries(${PROJECT_NAME} googletest fspp) add_test(${PROJECT_NAME} ${PROJECT_NAME}) -# This is needed by boost thread -if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") - target_link_libraries(${PROJECT_NAME} PUBLIC rt) -endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux") - target_enable_style_warnings(${PROJECT_NAME}) target_activate_cpp14(${PROJECT_NAME}) diff --git a/utils.cmake b/utils.cmake index 71b8cec8..15ba2be6 100644 --- a/utils.cmake +++ b/utils.cmake @@ -45,7 +45,7 @@ function(target_add_boost TARGET) REQUIRED COMPONENTS ${ARGN}) target_include_directories(${TARGET} SYSTEM PRIVATE ${Boost_INCLUDE_DIRS}) - target_link_libraries(${TARGET} PUBLIC ${Boost_LIBRARIES}) + target_link_libraries(${TARGET} PUBLIC ${Boost_LIBRARIES} rt) # Also link to rt, because boost thread needs that. endfunction(target_add_boost) ################################################## @@ -102,4 +102,4 @@ function(find_library_with_path OUTPUT_VARIABLE LIBRARY_NAME PATH_VARIABLE) message(STATUS "Found ${LIBRARY_NAME} in system location") endif(${OUTPUT_VARIABLE} MATCHES NOTFOUND) endif(${PATH_VARIABLE}) -endfunction(find_library_with_path) \ No newline at end of file +endfunction(find_library_with_path)