blob: 8197df7c53607381d0f33cc932224dadb85673db [file] [log] [blame]
Jan Tattermusch4d774492018-03-02 16:38:50 +01001#!/bin/sh
2# Copyright 2018 gRPC authors.
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16# Helper script to crosscompile grpc_csharp_ext native extension for Android.
17
Jan Tattermuschcfae76b2018-03-05 16:42:15 +010018set -ex
19
Jan Tattermusch4d774492018-03-02 16:38:50 +010020cd "$(dirname "$0")/../../../cmake"
21
22mkdir -p build
23cd build
24
25# set to the location where Android SDK is installed
Jan Tattermusch07678782018-04-12 13:56:03 +020026# e.g. ANDROID_NDK_PATH="$HOME/android-ndk-r16b"
Jan Tattermusch4d774492018-03-02 16:38:50 +010027
28cmake ../.. \
29 -DCMAKE_SYSTEM_NAME=Android \
30 -DCMAKE_SYSTEM_VERSION=15 \
31 -DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a \
Jan Tattermusch0f97a362018-03-02 17:18:19 +010032 -DCMAKE_ANDROID_NDK="${ANDROID_NDK_PATH}" \
Jan Tattermusch4d774492018-03-02 16:38:50 +010033 -DCMAKE_ANDROID_STL_TYPE=c++_static \
34 -DRUN_HAVE_POSIX_REGEX=0 \
35 -DRUN_HAVE_STD_REGEX=0 \
36 -DRUN_HAVE_STEADY_CLOCK=0 \
37 -DCMAKE_BUILD_TYPE=Release
38
Jan Tattermuschdcf340e2018-03-07 21:01:29 +010039make -j4 grpc_csharp_ext