Skip to content

Commit 79fa529

Browse files
committed
Android SDK build
1 parent 2029bbe commit 79fa529

File tree

1 file changed

+8
-6
lines changed
  • swift-ci/sdks/android

1 file changed

+8
-6
lines changed

swift-ci/sdks/android/build

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,19 +68,21 @@ pushd ${SDKROOT}/src/swift-project
6868
# https://github.com/finagolfin/swift-android-sdk/blob/main/swift-android.patch#L110
6969
perl -pi -e 's/#if os\(Windows\)/#if os\(Android\)/g' $PATCHDIR/swift-android.patch
7070

71+
# disable backtrace() for Android (needs either API33+ or libandroid-execinfo, or to manually add in backtrace backport)
72+
perl -pi -e 's/os\(Android\)/os\(AndroidDISABLED\)/g' swift-testing/Sources/Testing/SourceAttribution/Backtrace.swift
73+
# remove the need to link in android-execinfo
74+
perl -pi -e 's/dispatch android-execinfo/dispatch/g' $PATCHDIR/swift-android.patch
75+
76+
# fix for Process.swift:953:57: error: value of optional type 'posix_spawnattr_t?' (aka 'Optional<OpaquePointer>') must be unwrapped to a value of type 'posix_spawnattr_t' (aka 'OpaquePointer')
77+
#perl -pi -e 's%canImport\(Darwin\) \|\| os\(Android\) \|\| os\(OpenBSD\)%canImport\(Darwin\) || os\(AndroidXXX\) || os\(OpenBSD\)%g' swift-corelibs-foundation/Sources/Foundation/Process.swift
78+
7179
git apply $PATCHDIR/swift-android.patch || true
7280
git apply -C1 $PATCHDIR/swift-android-ci.patch || true
7381

7482
# need to un-apply libandroid-spawn since we don't need it for API28+
7583
perl -pi -e 's/MATCHES "Android"/MATCHES "AndroidDISABLED"/g' llbuild/lib/llvm/Support/CMakeLists.txt
7684
perl -pi -e 's/ STREQUAL Android\)/ STREQUAL AndroidDISABLED\)/g' swift-corelibs-foundation/Sources/Foundation/CMakeLists.txt
7785

78-
# fix for Process.swift:953:57: error: value of optional type 'posix_spawnattr_t?' (aka 'Optional<OpaquePointer>') must be unwrapped to a value of type 'posix_spawnattr_t' (aka 'OpaquePointer')
79-
#perl -pi -e 's%canImport\(Darwin\) \|\| os\(Android\) \|\| os\(OpenBSD\)%canImport\(Darwin\) || os\(AndroidXXX\) || os\(OpenBSD\)%g' swift-corelibs-foundation/Sources/Foundation/Process.swift
80-
81-
# disable backtrace() for Android (needs either API33+ or libandroid-execinfo, or to manually add in backtrace backport)
82-
perl -pi -e 's/os\(Android\)/os\(AndroidDISABLED\)/g' swift-testing/Sources/Testing/SourceAttribution/Backtrace.swift
83-
8486
git apply $PATCHDIR/swift-android-ci-release.patch || true
8587
git apply $PATCHDIR/swift-android-testing-release.patch || true
8688

0 commit comments

Comments
 (0)