-
Notifications
You must be signed in to change notification settings - Fork 10.5k
/
Copy pathbuild-toolchain
executable file
·48 lines (39 loc) · 1.71 KB
/
build-toolchain
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/env bash
#
# android/build-toolchain
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://swift.org/LICENSE.txt for license information
# See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
set -e
SWIFT_PATH="$( cd "$(dirname $0)/../../.." && pwd )"
ANDROID_NDK_PATH="${ANDROID_NDK_PATH:?Please set the Android NDK path in the ANDROID_NDK_PATH environment variable}"
ANDROID_ICU_PATH=${SWIFT_PATH}/libiconv-libicu-android
[ -e ${ANDROID_ICU_PATH} ] || exit 1
SWIFT_ANDROID_TOOLCHAIN_PATH="${SWIFT_PATH}/swift-android-toolchain"
rm -rf ${SWIFT_ANDROID_TOOLCHAIN_PATH}
${SWIFT_PATH}/swift/utils/build-script \
-R \
--android \
--android-ndk ${ANDROID_NDK_PATH} \
--android-api-level 21 \
--android-icu-uc "${ANDROID_ICU_PATH}/armeabi-v7a" \
--android-icu-uc-include "${ANDROID_ICU_PATH}/armeabi-v7a/icu/source/common" \
--android-icu-i18n "${ANDROID_ICU_PATH}/armeabi-v7a" \
--android-icu-i18n-include "${ANDROID_ICU_PATH}/armeabi-v7a/icu/source/i18n" \
--libdispatch --install-libdispatch \
--foundation --install-foundation \
--llbuild --install-llbuild \
--lldb --install-lldb \
--swiftpm --install-swiftpm \
--xctest --install-xctest \
--install-swift \
'--swift-install-components=autolink-driver;compiler;clang-builtin-headers;stdlib;swift-remote-mirror;sdk-overlay;dev' \
--install-prefix=/usr \
--install-destdir=${SWIFT_ANDROID_TOOLCHAIN_PATH}
${SWIFT_PATH}/swift-corelibs-libdispatch/build-android
${SWIFT_PATH}/swift-corelibs-foundation/build-android