Commit 67f064e 1 parent 2497ff5 commit 67f064e Copy full SHA for 67f064e
File tree 1 file changed +9
-0
lines changed
1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ if(NOT CMAKE_CXX_STANDARD)
11
11
set (CMAKE_CXX_STANDARD 14)
12
12
endif ()
13
13
14
+ include (CheckLibraryExists)
15
+
14
16
find_package (ament_cmake_python REQUIRED)
15
17
find_package (ament_cmake_ros REQUIRED)
16
18
@@ -121,6 +123,8 @@ if(BUILD_TESTING)
121
123
122
124
find_package (launch_testing_ament_cmake REQUIRED)
123
125
126
+ check_library_exists(atomic __atomic_load_8 "" HAVE_LIBATOMICS)
127
+
124
128
if (ament_cmake_cppcheck_FOUND)
125
129
ament_cppcheck(
126
130
TESTNAME "cppcheck_logging_macros"
@@ -214,6 +218,11 @@ if(BUILD_TESTING)
214
218
LANGUAGE C
215
219
)
216
220
target_link_libraries (test_atomics_executable ${PROJECT_NAME} )
221
+ if (HAVE_LIBATOMICS)
222
+ target_link_libraries (test_atomics_executable atomic)
223
+ ament_export_libraries(atomic)
224
+ endif ()
225
+
217
226
add_test (NAME test_atomics COMMAND test_atomics_executable)
218
227
219
228
rcutils_custom_add_gmock(test_error_handling test /test_error_handling.cpp
You can’t perform that action at this time.
0 commit comments