Commit dc19b4b 1 parent b26fdf4 commit dc19b4b Copy full SHA for dc19b4b
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
@@ -122,6 +124,8 @@ if(BUILD_TESTING)
122
124
123
125
find_package (launch_testing_ament_cmake REQUIRED)
124
126
127
+ check_library_exists(atomic __atomic_load_8 "" HAVE_LIBATOMICS)
128
+
125
129
if (ament_cmake_cppcheck_FOUND)
126
130
ament_cppcheck(
127
131
TESTNAME "cppcheck_logging_macros"
@@ -215,6 +219,11 @@ if(BUILD_TESTING)
215
219
LANGUAGE C
216
220
)
217
221
target_link_libraries (test_atomics_executable ${PROJECT_NAME} )
222
+ if (HAVE_LIBATOMICS)
223
+ target_link_libraries (test_atomics_executable atomic)
224
+ ament_export_libraries(atomic)
225
+ endif ()
226
+
218
227
add_test (NAME test_atomics COMMAND test_atomics_executable)
219
228
220
229
rcutils_custom_add_gmock(test_error_handling test /test_error_handling.cpp
You can’t perform that action at this time.
0 commit comments