Skip to content

Commit

Permalink
Merge pull request #1806 from ellert/atomic
Browse files Browse the repository at this point in the history
Make the check for the need for libatomic more thorough
  • Loading branch information
abh3 committed Nov 1, 2022
2 parents fb48506 + 98265bd commit ab9d568
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
12 changes: 5 additions & 7 deletions cmake/XRootDSystemCheck.cmake
Expand Up @@ -149,13 +149,11 @@ function(check_working_cxx_atomics varname)
#include <atomic>
#include <cstdint>
int main() {
std::atomic<int> a1(0);
int a1val = a1.load();
(void)a1val;
std::atomic<uint64_t> a2(0);
uint64_t a2val = a2.load(std::memory_order_relaxed);
(void)a2val;
return 0;
std::atomic<uint8_t> a1;
std::atomic<uint16_t> a2;
std::atomic<uint32_t> a3;
std::atomic<uint64_t> a4;
return a1++ + a2++ + a3++ + a4++;
}
" ${varname})
set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})
Expand Down
1 change: 1 addition & 0 deletions src/XrdServer.cmake
Expand Up @@ -191,6 +191,7 @@ target_link_libraries(
XrdUtils
${CMAKE_DL_LIBS}
${CMAKE_THREAD_LIBS_INIT}
${ATOMIC_LIBRARY}
${EXTRA_LIBS}
${SOCKET_LIBRARY} )

Expand Down

0 comments on commit ab9d568

Please sign in to comment.