Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions docker/android-clang_8/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.git/
.idea/

*.md
*.py
*.yml
**/*.sh
49 changes: 49 additions & 0 deletions docker/android-clang_8/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@

FROM conanio/android-clang8

ARG CONAN_VERSION

ENV ANDROID_ABI=arm64-v8a \
CC=$STANDALONE_TOOLCHAIN/bin/aarch64-linux-android21-clang \
CXX=$STANDALONE_TOOLCHAIN/bin/aarch64-linux-android21-clang++ \
LD=$STANDALONE_TOOLCHAIN/bin/aarch64-linux-android-ld \
AR=$STANDALONE_TOOLCHAIN/bin/aarch64-linux-android-ar \
AS=$STANDALONE_TOOLCHAIN/bin/aarch64-linux-android-as \
RANLIB=$STANDALONE_TOOLCHAIN/bin/aarch64-linux-android-ranlib \
STRIP=$STANDALONE_TOOLCHAIN/bin/aarch64-linux-android-strip \
ADDR2LINE=$STANDALONE_TOOLCHAIN/bin/aarch64-linux-android-addr2line \
NM=$STANDALONE_TOOLCHAIN/bin/aarch64-linux-android-nm \
OBJCOPY=$STANDALONE_TOOLCHAIN/bin/aarch64-linux-android-objcopy \
OBJDUMP=$STANDALONE_TOOLCHAIN/bin/aarch64-linux-android-objdump \
READELF=$STANDALONE_TOOLCHAIN/bin/aarch64-linux-android-readelf

RUN pip install conan==1.39.0 \
&& conan profile update settings.arch=armv8 default \
&& conan profile update settings.os=Android default \
&& conan profile update settings.os.api_level=21 default \
&& conan profile update settings.compiler.libcxx=libc++ default

RUN conan profile update settings.compiler.cppstd=17 default

RUN conan remote add conan-solar https://artifact.b-com.com/api/conan/solar-conan-local -i 0

RUN conan remote add conan-bcom https://artifact.b-com.com/api/conan/bcom-conan-local -i 1

RUN conan profile new host \
&& conan profile update settings.arch=armv8 host \
&& conan profile update settings.build_type=Release host \
&& conan profile update settings.compiler=clang host \
&& conan profile update settings.compiler.libcxx=libc++ host \
&& conan profile update settings.compiler.version=8 host \
&& conan profile update settings.os=Android host \
&& conan profile update settings.os.api_level=21 host \
&& conan profile update settings.compiler.cppstd=17 host

RUN conan profile new build \
&& conan profile update settings.arch=x86_64 build \
&& conan profile update settings.build_type=Release build \
&& conan profile update settings.compiler=gcc build \
&& conan profile update settings.compiler.libcxx=libstdc++ build \
&& conan profile update settings.compiler.version=7 build \
&& conan profile update settings.os=Linux build \
&& conan profile update settings.compiler.cppstd=17 build
32 changes: 32 additions & 0 deletions docker/android-clang_8/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Docker image to build Android dependencies of SolAR

## Description

This image defines a `build` and a `host` conan profiles and also adds `conan-bcom` and `conan-solar` remotes.

It is based on the android-clang8 image provided by the [ conan-docker-tools](https://github.com/conan-io/conan-docker-tools/tree/master/android-clang_8)

## How to use

### Build image
```
./build.sh
```

### Run container and connect open a Bash session
```
./run.sh
```

### Build dependency

For example you can run `conan install`, but don't forget to specify the `build` and `host` profiles.

```
conan install -pr:b build -pr:h host boost/1.74.0@ -o zlib=False -o bzip2=False -o numa=False -o shared=True -o without_stacktrace=True --build=missing
```

The built binaries will be located by default in your `~/.conan/data` by default, as specified in `run.sh`.

If you want to select another location for the build output, edit `run.sh`.

2 changes: 2 additions & 0 deletions docker/android-clang_8/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env bash
sudo docker build --no-cache -t b-com/android-clang8-solar .
37 changes: 37 additions & 0 deletions docker/android-clang_8/cmake-wrapper
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/usr/bin/env bash

ALL_ARGS=$@

BUILD=no
for i in "$@":
do
case $i in
--build)
BUILD=yes
;;
*)
;;
esac
done

# https://gitlab.kitware.com/cmake/cmake/issues/18739 Android: NDK r19 support
# https://github.com/conan-io/conan/issues/2402 Android and CONAN_LIBCXX do not play well together
# https://github.com/conan-io/conan/issues/4537 Pass ANDROID_ABI & ANDROID_NDK variables to cmake
# https://github.com/conan-io/conan/issues/4629 set(CMAKE_FIND_ROOT_PATH_MODE_* ONLY) when cross-compiling, for Android at least

if [ $BUILD == "yes" ]; then
cmake "$@"
else
cmake \
-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=$CMAKE_FIND_ROOT_PATH_MODE_PROGRAM \
-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=$CMAKE_FIND_ROOT_PATH_MODE_LIBRARY \
-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=$CMAKE_FIND_ROOT_PATH_MODE_INCLUDE \
-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=$CMAKE_FIND_ROOT_PATH_MODE_PACKAGE \
-DANDROID_STL=$ANDROID_STL \
-DANDROID_NDK=$ANDROID_NDK \
-DANDROID_ABI=$ANDROID_ABI \
-DANDROID_PLATFORM=$ANDROID_PLATFORM \
-DANDROID_TOOLCHAIN=$ANDROID_TOOLCHAIN \
"$@"
fi

2 changes: 2 additions & 0 deletions docker/android-clang_8/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env bash
sudo docker run --rm -v ~/.conan/data:/home/conan/.conan/data -it b-com/android-clang8-solar /bin/bash