-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'experimental': Improvements to the script via removal o…
…f hardcoded command to build xcframework
- Loading branch information
Showing
2 changed files
with
16 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,30 @@ | ||
# Build LLVM XCFramework | ||
# The script arguments are the platforms to build | ||
|
||
PLATFORMS=( "$@" ) | ||
|
||
# Build various tools such as automake, libtool | ||
export REPO_ROOT=`pwd` | ||
./build-tools.sh | ||
export PATH=$PATH:$REPO_ROOT/tools/bin | ||
|
||
# Download and extract ninja | ||
wget https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-mac.zip | ||
unzip ninja-mac.zip | ||
|
||
# Download prebuilt libffi | ||
wget https://github.com/light-tech/LLVM-On-iOS/releases/download/libffi_v3.3plus/libffi.tar.xz | ||
tar xzf libffi.tar.xz | ||
test -d libffi && echo "libffi was successfully extracted" | ||
|
||
git clone --single-branch --branch release/11.x https://github.com/llvm/llvm-project.git | ||
|
||
PLATFORMS=("iOS" "macOS") # iOS-Sim | ||
FRAMEWORKS_ARGS=() | ||
for p in ${PLATFORMS[@]}; do | ||
echo "Build LLVM for $p" | ||
./build-libffi.sh $p | ||
./build-llvm.sh $p | ||
./prepare-llvm.sh $p | ||
FRAMEWORKS_ARGS+=("-library" "LLVM-$p/llvm.a" "-headers" "LLVM-$p/include") | ||
tar -cJf LLVM-$p.tar.xz LLVM-$p/ | ||
tar -cJf LLVM-Clang-$p.tar.xz LLVM-$p/lib/clang/ | ||
done | ||
|
||
xcodebuild -create-xcframework -library LLVM-iOS/llvm.a -headers LLVM-iOS/include -library LLVM-macOS/llvm.a -headers LLVM-macOS/include -output LLVM.xcframework | ||
echo "Create XC framework with arguments" ${FRAMEWORKS_ARGS[@]} | ||
xcodebuild -create-xcframework ${FRAMEWORKS_ARGS[@]} -output LLVM.xcframework | ||
tar -cJf LLVM.xcframework.tar.xz LLVM.xcframework |