Jan Tattermusch | 4d77449 | 2018-03-02 16:38:50 +0100 | [diff] [blame] | 1 | #!/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 Tattermusch | cfae76b | 2018-03-05 16:42:15 +0100 | [diff] [blame] | 18 | set -ex |
| 19 | |
Jan Tattermusch | 4d77449 | 2018-03-02 16:38:50 +0100 | [diff] [blame] | 20 | cd "$(dirname "$0")/../../../cmake" |
| 21 | |
| 22 | mkdir -p build |
| 23 | cd build |
| 24 | |
| 25 | # set to the location where Android SDK is installed |
Jan Tattermusch | 0767878 | 2018-04-12 13:56:03 +0200 | [diff] [blame] | 26 | # e.g. ANDROID_NDK_PATH="$HOME/android-ndk-r16b" |
Jan Tattermusch | 4d77449 | 2018-03-02 16:38:50 +0100 | [diff] [blame] | 27 | |
| 28 | cmake ../.. \ |
| 29 | -DCMAKE_SYSTEM_NAME=Android \ |
| 30 | -DCMAKE_SYSTEM_VERSION=15 \ |
| 31 | -DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a \ |
Jan Tattermusch | 0f97a36 | 2018-03-02 17:18:19 +0100 | [diff] [blame] | 32 | -DCMAKE_ANDROID_NDK="${ANDROID_NDK_PATH}" \ |
Jan Tattermusch | 4d77449 | 2018-03-02 16:38:50 +0100 | [diff] [blame] | 33 | -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 Tattermusch | dcf340e | 2018-03-07 21:01:29 +0100 | [diff] [blame] | 39 | make -j4 grpc_csharp_ext |