@@ -100,7 +100,7 @@ declare_package zlib "zlib" "Zlib" "https://zlib.net"
100
100
# Parse command line arguments
101
101
android_sdk_version=0.1
102
102
sdk_name=
103
- archs=aarch64,armv7,x86_64,x86
103
+ archs=aarch64,armv7,x86_64
104
104
android_api=28
105
105
build_type=Release
106
106
parallel_jobs=$(( $(nproc -- all) + 2 ))
@@ -196,12 +196,16 @@ function quiet_popd {
196
196
header " Swift Android SDK build script"
197
197
198
198
swift_dir=$( realpath $( dirname " $swiftc " ) /..)
199
+ HOST=linux-x86_64
200
+ # HOST=$(uname -s -m | tr '[:upper:]' '[:lower:]' | tr ' ' '-')
201
+ ndk_toolchain=$ndk_home /toolchains/llvm/prebuilt/$HOST
202
+
199
203
200
204
echo " Swift found at ${swift_dir} "
201
205
echo " Host toolchain found at ${host_toolchain} "
202
206
${host_toolchain} /bin/swift --version
203
207
echo " Android NDK found at ${ndk_home} "
204
- ${toolchain } /bin/clang --version
208
+ ${ndk_toolchain } /bin/clang --version
205
209
echo " Building for ${archs} "
206
210
echo " Sources are in ${source_dir} "
207
211
echo " Build will happen in ${build_dir} "
@@ -219,17 +223,12 @@ function run() {
219
223
" $@ "
220
224
}
221
225
222
- HOST=linux-x86_64
223
- # HOST=$(uname -s -m | tr '[:upper:]' '[:lower:]' | tr ' ' '-')
224
-
225
- ndktoolchain=$ndk_home /toolchains/llvm/prebuilt/$HOST
226
-
227
226
for arch in $archs ; do
228
227
case $arch in
229
228
armv7) target_host=" arm-linux-androideabi" ; compiler_target_host=" armv7a-linux-androideabi$android_api " ; android_abi=" armeabi-v7a" ;;
230
229
aarch64) target_host=" aarch64-linux-android" ; compiler_target_host=" $target_host$android_api " ; android_abi=" arm64-v8a" ;;
231
- x86) target_host=" x86-linux-android" ; compiler_target_host=" $target_host$android_api " ; android_abi=" x86" ;;
232
230
x86_64) target_host=" x86_64-linux-android" ; compiler_target_host=" $target_host$android_api " ; android_abi=" x86_64" ;;
231
+ x86) target_host=" x86-linux-android" ; compiler_target_host=" $target_host$android_api " ; android_abi=" x86" ;;
233
232
* ) echo " Unknown architecture '$1 '" ; usage; exit 0 ;;
234
233
esac
235
234
@@ -335,6 +334,9 @@ for arch in $archs; do
335
334
RelWithDebInfo) build_type_flag=" --release-debuginfo" ;;
336
335
esac
337
336
337
+ # use an out-of-tree build folder, otherwise subsequent arch builds have conflicts
338
+ export SWIFT_BUILD_ROOT=${build_dir} /$arch /swift-project
339
+
338
340
./swift/utils/build-script \
339
341
$build_type_flag \
340
342
--reconfigure \
0 commit comments