Skip to content

Commit ab752cd

Browse files
authored
Apply latest env variables in github host runner to fix CI (#1334)
Currently we are using `ANDROID_HOME` and `ANDROID_NDK_LATEST_HOME`. All variables should follow definitions in https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-Readme.md#environment-variables-3
1 parent 8de5168 commit ab752cd

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

doc/build_wamr.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -527,13 +527,13 @@ able to generate a shared library support Android platform.
527527
- look for a command named *sdkmanager* and download below components. version numbers might need to check and pick others
528528
- "build-tools;29.0.3"
529529
- "cmake;3.10.2.4988404"
530-
- "ndk;21.0.6113669"
530+
- "ndk;latest"
531531
- "patcher;v4"
532532
- "platform-tools"
533533
- "platforms;android-29"
534534
- add bin/ of the downloaded cmake to $PATH
535-
- export ANDROID_SDK_HOME=/the/path/of/downloaded/sdk/
536-
- export ANDROID_NDK_HOME=/the/path/of/downloaded/sdk/ndk/
535+
- export ANDROID_HOME=/the/path/of/downloaded/sdk/
536+
- export ANDROID_NDK_LATEST_HOME=/the/path/of/downloaded/sdk/ndk/2x.xxx/
537537
- ready to go
538538
539539
Use such commands, you are able to compile with default configurations. Any compiling requirement should be satisfied by modifying product-mini/platforms/android/CMakeList.txt. For example, chaning ${WAMR_BUILD_TARGET} in CMakeList could get different libraries support different ABIs.

product-mini/platforms/android/CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ cmake_minimum_required (VERSION 3.4.1)
66
set (CMAKE_VERBOSE_MAKEFILE on)
77
set (CMAKE_BUILD_TYPE Release)
88

9-
set (CMAKE_TOOLCHAIN_FILE "$ENV{ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake")
10-
set (ANDROID_NDK $ENV{ANDROID_NDK_HOME})
11-
set (ANDROID_SDK $ENV{ANDROID_SDK_HOME})
9+
# https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-Readme.md#environment-variables-3
10+
set (CMAKE_TOOLCHAIN_FILE "$ENV{ANDROID_NDK_LATEST_HOME}/build/cmake/android.toolchain.cmake")
11+
set (ANDROID_SDK $ENV{ANDROID_HOME})
12+
set (ANDROID_NDK $ENV{ANDROID_NDK_LATEST_HOME})
13+
1214
set (ANDROID_ABI "x86")
1315
set (ANDROID_LD lld)
1416
if (NOT DEFINED ANDROID_PLATFORM)

0 commit comments

Comments
 (0)