Skip to content

Commit

Permalink
[macos] build universal library in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
nil4 committed Nov 4, 2024
1 parent 694a99f commit fbcba68
Show file tree
Hide file tree
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
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit fbcba68

Please sign in to comment.