diff --git a/cmake/XRootDSystemCheck.cmake b/cmake/XRootDSystemCheck.cmake index 52f9ba6411b..8af86886300 100644 --- a/cmake/XRootDSystemCheck.cmake +++ b/cmake/XRootDSystemCheck.cmake @@ -149,13 +149,11 @@ function(check_working_cxx_atomics varname) #include #include int main() { - std::atomic a1(0); - int a1val = a1.load(); - (void)a1val; - std::atomic a2(0); - uint64_t a2val = a2.load(std::memory_order_relaxed); - (void)a2val; - return 0; + std::atomic a1; + std::atomic a2; + std::atomic a3; + std::atomic a4; + return a1++ + a2++ + a3++ + a4++; } " ${varname}) set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS}) diff --git a/src/XrdServer.cmake b/src/XrdServer.cmake index 4006976d529..d5d2e453347 100644 --- a/src/XrdServer.cmake +++ b/src/XrdServer.cmake @@ -191,6 +191,7 @@ target_link_libraries( XrdUtils ${CMAKE_DL_LIBS} ${CMAKE_THREAD_LIBS_INIT} + ${ATOMIC_LIBRARY} ${EXTRA_LIBS} ${SOCKET_LIBRARY} )