Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[macos] build universal library in CI
Browse files Browse the repository at this point in the history
nil4 committed Nov 4, 2024

Partially verified

This commit is signed with the committer’s verified signature.
spydon’s contribution has been verified via GPG key.
We cannot verify signatures from co-authors, and some of the co-authors attributed to this commit require their commits to be signed.
1 parent 694a99f commit fbcba68
Showing 2 changed files with 15 additions and 3 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/x-win.yml
Original file line number Diff line number Diff line change
@@ -89,7 +89,21 @@ jobs:

# build RoyalVNCKit

- name: build RoyalVNCKit (Apple)
if: "success() && matrix.env.OS == 'apple'"
run: |
swift package clean --configuration release
swift build --configuration release --arch arm64
swift build --configuration release --arch x86_64
mkdir -p ./build/universal-apple-macosx/release
lipo -create \
.build/arm64-apple-macosx/release/libRoyalVNCKit.dylib \
.build/x86_64-apple-macosx/release/libRoyalVNCKit.dylib \
-output .build/universal-apple-macosx/release/libRoyalVNCKit.dylib
- name: build RoyalVNCKit
if: "success() && matrix.env.OS != 'apple'"
run: |
swift package clean --configuration release
swift build --configuration release
Original file line number Diff line number Diff line change
@@ -26,9 +26,7 @@
<_NativeLibrary>$(_SwiftBuildDir)$(_NativeArch)-unknown-linux-gnu\$(_NativeCfg)\libRoyalVNCKit.so</_NativeLibrary>
</PropertyGroup>
<PropertyGroup Label="macOS" Condition="$([MSBuild]::IsOSPlatform('OSX'))">
<_SwiftArch Condition="'$(_NativeArch)' == 'aarch64'">arm64</_SwiftArch>
<_SwiftArch Condition="'$(_SwiftArch)' == ''">$(_NativeArch)</_SwiftArch>
<_NativeLibrary>$(_SwiftBuildDir)$(_SwiftArch)-apple-macosx\$(_NativeCfg)\libRoyalVNCKit.dylib</_NativeLibrary>
<_NativeLibrary>$(_SwiftBuildDir)universal-apple-macosx\$(_NativeCfg)\libRoyalVNCKit.dylib</_NativeLibrary>
</PropertyGroup>
<PropertyGroup Label="Windows" Condition="$([MSBuild]::IsOSPlatform('Windows'))">
<_NativeLibrary>$(_SwiftBuildDir)$(_NativeArch)-unknown-windows-msvc\$(_NativeCfg)\RoyalVNCKit.dll</_NativeLibrary>

0 comments on commit fbcba68

Please sign in to comment.