Skip to content

Commit 2bb6519

Browse files
Try to fix atomic.lib on msvc
https://stackoverflow.com/a/64112384
1 parent fff6ee3 commit 2bb6519

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ if(WIN32)
1616
)
1717
# set the same behavior for windows as it is on linux
1818
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
19-
20-
set(FOUND_LIBATOMIC TRUE)
2119
endif()
2220

2321
set(THIS_PACKAGE_INCLUDE_DEPENDS
@@ -84,6 +82,11 @@ if(BUILD_TESTING)
8482
ament_add_gmock(realtime_buffer_tests test/realtime_buffer_tests.cpp)
8583
target_link_libraries(realtime_buffer_tests realtime_tools)
8684

85+
if(WIN32)
86+
set(HAVE_CXX_ATOMICS64_WITHOUT_LIB True)
87+
set(HAVE_CXX_ATOMICS_WITHOUT_LIB True)
88+
set(FOUND_LIBATOMIC TRUE)
89+
endif()
8790
ament_add_gmock(lock_free_queue_tests test/lock_free_queue_tests.cpp)
8891
target_link_libraries(lock_free_queue_tests realtime_tools atomic Boost::boost)
8992

0 commit comments

Comments
 (0)