Skip to content

Commit

Permalink
[Mac Build] Add stdlib build
Browse files Browse the repository at this point in the history
* Add cache files for the stdlib build
* Adapt stdlib job to build for both Windows and Mac.
  • Loading branch information
Steelskin committed Nov 7, 2024
1 parent bc764e1 commit 224bb19
Show file tree
Hide file tree
Showing 4 changed files with 172 additions and 138 deletions.
64 changes: 59 additions & 5 deletions .github/workflows/build-toolchain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -354,72 +354,114 @@ jobs:
"include": [
{
"arch": "amd64",
"cpu": "x86_64",
"os": "Windows",
"platform": "Windows",
"triple": "x86_64-unknown-windows-msvc",
"triple_no_api_level": "x86_64-unknown-windows-msvc",
"cc": "cl",
"cflags": "${{ steps.context.outputs.WINDOWS_CMAKE_C_FLAGS }}",
"cxx": "cl",
"cxxflags": "${{ steps.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}",
"swiftflags": "${{ steps.context.outputs.WINDOWS_CMAKE_Swift_FLAGS }}",
"cmake_linker_flags": "-D CMAKE_EXE_LINKER_FLAGS=\"${{ steps.context.outputs.WINDOWS_CMAKE_EXE_LINKER_FLAGS }}\" -D CMAKE_SHARED_LINKER_FLAGS=\"${{ steps.context.outputs.WINDOWS_CMAKE_EXE_LINKER_FLAGS }}\"",
"llvm_flags": "",
"extra_flags": "-D CMAKE_SYSTEM_PROCESSOR=AMD64 -D CMAKE_MT=mt"
},
{
"arch": "arm64",
"cpu": "aarch64",
"os": "Windows",
"platform": "Windows",
"triple": "aarch64-unknown-windows-msvc",
"triple_no_api_level": "aarch64-unknown-windows-msvc",
"cc": "cl",
"cflags": "${{ steps.context.outputs.WINDOWS_CMAKE_C_FLAGS }}",
"cxx": "cl",
"cxxflags": "${{ steps.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}",
"swiftflags": "${{ steps.context.outputs.WINDOWS_CMAKE_Swift_FLAGS }}",
"cmake_linker_flags": "-D CMAKE_EXE_LINKER_FLAGS=\"${{ steps.context.outputs.WINDOWS_CMAKE_EXE_LINKER_FLAGS }}\" -D CMAKE_SHARED_LINKER_FLAGS=\"${{ steps.context.outputs.WINDOWS_CMAKE_EXE_LINKER_FLAGS }}\"",
"llvm_flags": "",
"extra_flags": "-D CMAKE_SYSTEM_PROCESSOR=ARM64 -D CMAKE_MT=mt"
},
{
"arch": "x86",
"cpu": "i686",
"os": "Windows",
"platform": "Windows",
"triple": "i686-unknown-windows-msvc",
"triple_no_api_level": "i686-unknown-windows-msvc",
"cc": "cl",
"cflags": "${{ steps.context.outputs.WINDOWS_CMAKE_C_FLAGS }}",
"cxx": "cl",
"cxxflags": "${{ steps.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}",
"swiftflags": "",
"cmake_linker_flags": "-D CMAKE_EXE_LINKER_FLAGS=\"${{ steps.context.outputs.WINDOWS_CMAKE_EXE_LINKER_FLAGS }}\" -D CMAKE_SHARED_LINKER_FLAGS=\"${{ steps.context.outputs.WINDOWS_CMAKE_EXE_LINKER_FLAGS }}\"",
"llvm_flags": "",
"extra_flags": "-D CMAKE_SYSTEM_PROCESSOR=X86 -D CMAKE_MT=mt"
},
{
"arch": "arm64",
"cpu": "aarch64",
"os": "Android",
"platform": "Android",
"triple": "aarch64-unknown-linux-android${{ inputs.ANDROID_API_LEVEL }}",
"triple_no_api_level": "aarch64-unknown-linux-android",
"cc": "clang",
"cflags": "${{ steps.context.outputs.ANDROID_CMAKE_C_FLAGS }}",
"cxx": "clang++",
"cxxflags": "${{ steps.context.outputs.ANDROID_CMAKE_CXX_FLAGS }}",
"swiftflags": "",
"swiftflags": "-sdk $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/sysroot -Xclang-linker -target -Xclang-linker aarch64-unknown-linux-android${{ inputs.ANDROID_API_LEVEL }} -Xclang-linker --sysroot -Xclang-linker $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/sysroot -Xclang-linker -resource-dir -Xclang-linker $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/lib/clang/17 -L ${{ github.workspace }}/BinaryCache/swift/lib/swift/android -g",
"cmake_linker_flags": "-D CMAKE_EXE_LINKER_FLAGS=\"${{ steps.context.outputs.ANDROID_CMAKE_EXE_LINKER_FLAGS }}\" -D CMAKE_SHARED_LINKER_FLAGS=\"${{ steps.context.outputs.ANDROID_CMAKE_SHARED_LINKER_FLAGS }}\"",
"llvm_flags": "-DCMAKE_SYSTEM_PROCESSOR=aarch64 -DLLVM_HOST_TRIPLE=aarch64-unknown-linux-android${{ inputs.ANDROID_API_LEVEL }}",
"extra_flags": "-DCMAKE_ANDROID_API=${{ inputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a"
},
{
"arch": "armv7",
"cpu": "armv7-a",
"os": "Android",
"platform": "Android",
"triple": "armv7-unknown-linux-androideabi${{ inputs.ANDROID_API_LEVEL }}",
"triple_no_api_level": "armv7-unknown-linux-androideabi",
"cc": "clang",
"cflags": "${{ steps.context.outputs.ANDROID_CMAKE_C_FLAGS }}",
"cxx": "clang++",
"cxxflags": "${{ steps.context.outputs.ANDROID_CMAKE_CXX_FLAGS }}",
"swiftflags": "",
"swiftflags": "-sdk $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/sysroot -Xclang-linker -target -Xclang-linker armv7a-unknown-linux-androideabi${{ inputs.ANDROID_API_LEVEL }} -Xclang-linker --sysroot -Xclang-linker $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/sysroot -Xclang-linker -resource-dir -Xclang-linker $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/lib/clang/17 -L ${{ github.workspace }}/BinaryCache/swift/lib/swift/android -g",
"cmake_linker_flags": "-D CMAKE_EXE_LINKER_FLAGS=\"${{ steps.context.outputs.ANDROID_CMAKE_EXE_LINKER_FLAGS }}\" -D CMAKE_SHARED_LINKER_FLAGS=\"${{ steps.context.outputs.ANDROID_CMAKE_SHARED_LINKER_FLAGS }}\"",
"llvm_flags": "-DCMAKE_SYSTEM_PROCESSOR=armv7-a -DLLVM_HOST_TRIPLE=armv7a-unknown-linux-androideabi${{ inputs.ANDROID_API_LEVEL }}",
"extra_flags": "-DCMAKE_ANDROID_API=${{ inputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a"
},
{
"arch": "i686",
"cpu": "i686",
"os": "Android",
"platform": "Android",
"triple": "i686-unknown-linux-android${{ inputs.ANDROID_API_LEVEL }}",
"triple_no_api_level": "i686-unknown-linux-android",
"cc": "clang",
"cflags": "${{ steps.context.outputs.ANDROID_CMAKE_C_FLAGS }}",
"cxx": "clang++",
"cxxflags": "${{ steps.context.outputs.ANDROID_CMAKE_CXX_FLAGS }}",
"swiftflags": "",
"swiftflags": "-sdk $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/sysroot -Xclang-linker -target -Xclang-linker i686-unknown-linux-android${{ inputs.ANDROID_API_LEVEL }} -Xclang-linker --sysroot -Xclang-linker $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/sysroot -Xclang-linker -resource-dir -Xclang-linker $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/lib/clang/17 -L ${{ github.workspace }}/BinaryCache/swift/lib/swift/android -g",
"cmake_linker_flags": "-D CMAKE_EXE_LINKER_FLAGS=\"${{ steps.context.outputs.ANDROID_CMAKE_EXE_LINKER_FLAGS }}\" -D CMAKE_SHARED_LINKER_FLAGS=\"${{ steps.context.outputs.ANDROID_CMAKE_SHARED_LINKER_FLAGS }}\"",
"llvm_flags": "-DCMAKE_SYSTEM_PROCESSOR=i686 -DLLVM_HOST_TRIPLE=i686-unknown-linux-android${{ inputs.ANDROID_API_LEVEL }}",
"extra_flags": "-DCMAKE_ANDROID_API=${{ inputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=x86"
},
{
"arch": "x86_64",
"cpu": "x86_64",
"os": "Android",
"platform": "Android",
"triple": "x86_64-unknown-linux-android${{ inputs.ANDROID_API_LEVEL }}",
"triple_no_api_level": "x86_64-unknown-linux-android",
"cc": "clang",
"cflags": "${{ steps.context.outputs.ANDROID_CMAKE_C_FLAGS }}",
"cxx": "clang++",
"cxxflags": "${{ steps.context.outputs.ANDROID_CMAKE_CXX_FLAGS }}",
"swiftflags": "",
"swiftflags": "-sdk $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/sysroot -Xclang-linker -target -Xclang-linker x86_64-unknown-linux-android${{ inputs.ANDROID_API_LEVEL }} -Xclang-linker --sysroot -Xclang-linker $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/sysroot -Xclang-linker -resource-dir -Xclang-linker $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/lib/clang/17 -L ${{ github.workspace }}/BinaryCache/swift/lib/swift/android -g",
"cmake_linker_flags": "-D CMAKE_EXE_LINKER_FLAGS=\"${{ steps.context.outputs.ANDROID_CMAKE_EXE_LINKER_FLAGS }}\" -D CMAKE_SHARED_LINKER_FLAGS=\"${{ steps.context.outputs.ANDROID_CMAKE_SHARED_LINKER_FLAGS }}\"",
"llvm_flags": "-DCMAKE_SYSTEM_PROCESSOR=x86_64 -DLLVM_HOST_TRIPLE=x86_64-unknown-linux-android${{ inputs.ANDROID_API_LEVEL }}",
"extra_flags": "-DCMAKE_ANDROID_API=${{ inputs.ANDROID_API_LEVEL }} -DCMAKE_ANDROID_ARCH_ABI=x86_64"
}
]
Expand Down Expand Up @@ -471,22 +513,34 @@ jobs:
"include": [
{
"arch": "x86_64",
"cpu": "x86_64",
"os": "Darwin",
"platform": "MacOSX",
"triple": "x86_64-apple-macosx15.0",
"triple_no_api_level": "x86_64-apple-macosx15.0",
"cc": "clang",
"cflags": "${{ steps.context.outputs.DARWIN_CMAKE_C_FLAGS }}",
"cxx": "clang++",
"cxxflags": "${{ steps.context.outputs.DARWIN_CMAKE_CXX_FLAGS }}",
"swiftflags": "${{ steps.context.outputs.DARWIN_CMAKE_Swift_FLAGS }}",
"cmake_linker_flags": "-D CMAKE_EXE_LINKER_FLAGS=\"${{ steps.context.outputs.DARWIN_CMAKE_EXE_LINKER_FLAGS }}\" -D CMAKE_SHARED_LINKER_FLAGS=\"${{ steps.context.outputs.DARWIN_CMAKE_SHARED_LINKER_FLAGS }}\"",
"llvm_flags": "",
"extra_flags": "-D CMAKE_SYSTEM_PROCESSOR=x86_64 -D CMAKE_OSX_DEPLOYMENT_TARGET=10.15 -D CMAKE_OSX_ARCHITECTURES=x86_64"
},
{
"arch": "arm64",
"cpu": "aarch64",
"os": "Darwin",
"platform": "MacOSX",
"triple": "aarch64-apple-macosx15.0",
"triple_no_api_level": "aarch64-apple-macosx15.0",
"cc": "clang",
"cflags": "${{ steps.context.outputs.DARWIN_CMAKE_C_FLAGS }}",
"cxx": "clang++",
"cxxflags": "${{ steps.context.outputs.DARWIN_CMAKE_CXX_FLAGS }}",
"swiftflags": "${{ steps.context.outputs.DARWIN_CMAKE_Swift_FLAGS }}",
"cmake_linker_flags": "-D CMAKE_EXE_LINKER_FLAGS=\"${{ steps.context.outputs.DARWIN_CMAKE_EXE_LINKER_FLAGS }}\" -D CMAKE_SHARED_LINKER_FLAGS=\"${{ steps.context.outputs.DARWIN_CMAKE_SHARED_LINKER_FLAGS }}\"",
"llvm_flags": "",
"extra_flags": "-D CMAKE_SYSTEM_PROCESSOR=arm64 -D CMAKE_OSX_DEPLOYMENT_TARGET=10.15 -D CMAKE_OSX_ARCHITECTURES=arm64"
}
]
Expand Down Expand Up @@ -578,7 +632,7 @@ jobs:
uses: ./.github/workflows/swift-toolchain.yml
with:
build_os: Darwin
build_arch: aarch64
build_arch: arm64
build_matrix: ${{ needs.context.outputs.darwin_build_matrix }}
host_matrix: ${{ needs.context.outputs.darwin_host_matrix }}
target_matrix: ${{ needs.context.outputs.darwin_target_matrix }}
Expand Down
Loading

0 comments on commit 224bb19

Please sign in to comment.