Closed gshahbazian closed 3 years ago
The debug configuration still broken. But i was able to build SwiftGumbo release configuration with following command:
export SWIFT_EXEC=/PathToDownloadedToolchain/swift-android-toolchain/usr/bin/swiftc-arm-linux-androideabi
swift build -c release --destination ./android-armv7.json
Where ./android-armv7.json
is below:
{
"version": 1,
"sdk": "/PathToDownloadedToolchain/swift-android-toolchain",
"toolchain-bin-dir": "/usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/bin",
"target": "armv7-none-linux-androideabi",
"dynamic-library-extension": "so",
"extra-cc-flags": [
"-v",
"-I/usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include",
"-I/usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/arm-linux-androideabi"
],
"extra-swiftc-flags": [
"-v",
"-tools-directory",
"/usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/bin",
"-Xcc",
"-I/usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include",
"-Xcc",
"-I/usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/arm-linux-androideabi",
"-Xclang-linker",
"--sysroot=/usr/local/ndk/20.1.5948944/platforms/android-24/arch-arm",
"-Xclang-linker",
"--gcc-toolchain=/usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64",
"-L",
"/usr/local/ndk/20.1.5948944/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a",
"-L",
"/usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/lib/gcc/arm-linux-androideabi/4.9.x",
"-L",
"/usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib/arm-linux-androideabi/24",
"-L",
"/PathToDownloadedToolchain/swift-android-toolchain/usr/lib/swift/android/armv7"
],
"extra-cpp-flags": [
"-v"
]
}
This is an archived sample project with two build scripts (for macOS and Android). SwiftGumboTest.zip
Also possible now (fix still in develop branch) to build without --destination
flag.
cd SwiftGumboProject
/...../swift-android-toolchain/usr/bin/swift-build-arm-linux-androideabi -c release
Ok. The issue with SPM Debug Builds now fixed in https://github.com/vgorloff/swift-everywhere-toolchain/releases/tag/1.0.57. Closing issue.
Thanks for all your work on this @vgorloff!
Hey @vgorloff thanks for all the great work here!
I am running into a linker error when importing a swift package that wraps a C library. Package being imported: https://github.com/gshahbazian/SwiftGumbo
Exports.swift:
Package.swift:
Compile error: