Skip to content

Commit 2b2d8af

Browse files
mergify[bot]kneep
andauthored
Add basic support for rclc demos to support Android (#51) (#52)
* Add missing a missing dependency: visualization_msgs Signed-off-by: Joel Cao <joel.cao@oppo.com> * Pass cross compiling flags to sub-projects Signed-off-by: Joel Cao <joel.cao@oppo.com> Co-authored-by: Joel Cao <joel.cao@oppo.com> (cherry picked from commit 4ab3395) Co-authored-by: kneep <alvin.cao@gmail.com>
1 parent 2f2d967 commit 2b2d8af

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

rclc/CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@ find_package(ament_cmake REQUIRED)
77
include(ExternalProject)
88
include(CMakeParseArguments)
99

10+
if(ANDROID)
11+
set(CROSS_CMAKE_ARGS
12+
-DCMAKE_TOOLCHAIN_FILE:PATH=${CMAKE_TOOLCHAIN_FILE}
13+
-DCMAKE_SYSTEM_VERSION:STRING=${CMAKE_SYSTEM_VERSION}
14+
-DCMAKE_ANDROID_ARCH_ABI:STRING=${CMAKE_ANDROID_ARCH_ABI}
15+
-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE:STRING=BOTH
16+
)
17+
endif()
18+
1019
function(export_executable)
1120
set(subtree "")
1221
foreach(arg IN LISTS ARGN)
@@ -26,6 +35,7 @@ function(export_executable)
2635
-DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS}
2736
-DCMAKE_PREFIX_PATH:PATH=${CMAKE_PREFIX_PATH}
2837
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
38+
${CROSS_CMAKE_ARGS}
2939
)
3040
endfunction()
3141

rclc/package.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
<depend>example_interfaces</depend>
2020
<depend>complex_msgs</depend>
2121
<depend>sensor_msgs</depend>
22+
<depend>visualization_msgs</depend>
2223
<depend>builtin_interfaces</depend>
2324
<depend>microxrcedds_client</depend>
2425
<depend>micro_ros_utilities</depend>
@@ -31,4 +32,4 @@
3132
<build_type>ament_cmake</build_type>
3233
</export>
3334

34-
</package>
35+
</package>

0 commit comments

Comments
 (0)