Merge pull request #200 from Nadav-Eyesight/android_more_variables

Android - Use clang and add an API variable
This commit is contained in:
Matt McCormick 2018-04-02 14:32:01 -04:00 committed by GitHub
commit f403246365
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 6 deletions

View File

@ -11,12 +11,13 @@ ENV CROSS_TRIPLE=arm-linux-androideabi
ENV CROSS_ROOT=/usr/${CROSS_TRIPLE} ENV CROSS_ROOT=/usr/${CROSS_TRIPLE}
ENV AS=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-as \ ENV AS=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-as \
AR=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-ar \ AR=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-ar \
CC=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-gcc \ CC=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-clang \
CPP=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-cpp \ CPP=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-cpp \
CXX=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-g++ \ CXX=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-clang++ \
LD=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-ld LD=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-ld
ENV ANDROID_NDK_REVISION 13b ENV ANDROID_NDK_REVISION 16b
ENV ANDROID_NDK_API 16
RUN mkdir -p /build && \ RUN mkdir -p /build && \
cd /build && \ cd /build && \
curl -O https://dl.google.com/android/repository/android-ndk-r${ANDROID_NDK_REVISION}-linux-x86_64.zip && \ curl -O https://dl.google.com/android/repository/android-ndk-r${ANDROID_NDK_REVISION}-linux-x86_64.zip && \
@ -24,7 +25,8 @@ RUN mkdir -p /build && \
cd android-ndk-r${ANDROID_NDK_REVISION} && \ cd android-ndk-r${ANDROID_NDK_REVISION} && \
./build/tools/make_standalone_toolchain.py \ ./build/tools/make_standalone_toolchain.py \
--arch arm \ --arch arm \
--api 16 \ --api ${ANDROID_NDK_API} \
--stl=libc++ \
--install-dir=${CROSS_ROOT} && \ --install-dir=${CROSS_ROOT} && \
cd / && \ cd / && \
rm -rf /build && \ rm -rf /build && \

View File

@ -6,8 +6,8 @@ set(CMAKE_ANDROID_STANDALONE_TOOLCHAIN /usr/${cross_triple}/)
set(CMAKE_ANDROID_ARM_MODE 1) set(CMAKE_ANDROID_ARM_MODE 1)
set(CMAKE_ANDROID_ARM_NEON 1) set(CMAKE_ANDROID_ARM_NEON 1)
set(CMAKE_C_COMPILER /usr/${cross_triple}/bin/${cross_triple}-gcc) set(CMAKE_C_COMPILER /usr/${cross_triple}/bin/${cross_triple}-clang)
set(CMAKE_CXX_COMPILER /usr/${cross_triple}/bin/${cross_triple}-g++) set(CMAKE_CXX_COMPILER /usr/${cross_triple}/bin/${cross_triple}-clang++)
set(CMAKE_FIND_ROOT_PATH /usr/${cross_triple}) set(CMAKE_FIND_ROOT_PATH /usr/${cross_triple})
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)