Skip to content

Commit b66b9b7

Browse files
committed
Android CI
1 parent 230a26f commit b66b9b7

File tree

2 files changed

+59
-0
lines changed

2 files changed

+59
-0
lines changed

.github/workflows/android.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Android
2+
3+
on:
4+
push:
5+
branches: ['androidci']
6+
paths_ignore: ['docs/**', '.travis.yml']
7+
workflow_dispatch:
8+
inputs:
9+
cmakeextra:
10+
description: 'Extra CMake options'
11+
required: false
12+
default: ''
13+
14+
defaults:
15+
run:
16+
shell: bash
17+
18+
19+
jobs:
20+
build:
21+
name: ${{ matrix.config.arch }}
22+
runs-on: ubuntu-latest
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
config:
27+
- {arch: "x86"}
28+
- {arch: "armeabi-v7a" }
29+
- {arch: "arm64-v8a"}
30+
31+
steps:
32+
- uses: actions/checkout@v2
33+
34+
- name: Configure CMake
35+
run: |
36+
cmake --version
37+
cmake -S . -B build \
38+
-DCMAKE_BUILD_TYPE=Release \
39+
-DCMAKE_INSTALL_PREFIX=${PWD}/install \
40+
-DLSL_UNITTESTS=ON \
41+
-DCPACK_PACKAGE_DIRECTORY=${PWD}/package \
42+
-Dlslgitrevision=${{ github.sha }} \
43+
-Dlslgitbranch=${{ github.ref }} \
44+
-DCMAKE_SYSTEM_NAME=Android \
45+
-DCMAKE_SYSTEM_VERSION=30 \
46+
-DCMAKE_ANDROID_ARCH_ABI=${{ matrix.config.arch }}
47+
${{ matrix.config.cmake_extra }}
48+
echo ${PWD}
49+
- name: make
50+
run: cmake --build build --target install --config Release -j
51+
- name: upload install dir
52+
uses: actions/upload-artifact@master
53+
with:
54+
name: build-android-${{ matrix.config.arch }}
55+
path: install
56+

testing/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ option(LSL_BENCHMARKS "Enable benchmarks in unit tests" OFF)
1010

1111
add_library(catch_main OBJECT catch_main.cpp)
1212
target_compile_features(catch_main PUBLIC cxx_std_11)
13+
if(CMAKE_SYSTEM_NAME STREQUAL "Android")
14+
target_link_libraries(catch_main PUBLIC log)
15+
endif()
1316

1417
target_compile_definitions(catch_main PRIVATE LSL_VERSION_INFO="${LSL_VERSION_INFO}")
1518
if(LSL_BENCHMARKS)

0 commit comments

Comments
 (0)