Skip to content

Conversation

@SteveL-MSFT
Copy link
Member

@SteveL-MSFTSteveL-MSFT commented Feb 28, 2021

Created cmakefile specifying both x64 and arm64 architectures. Tested locally on M1 MacBookPro using file to verify the resulting dylib is universal.

PS> file /Users/steve/repos/PowerShell-Native/src/powershell-unix/libpsl-native.dylib/Users/steve/repos/PowerShell-Native/src/powershell-unix/libpsl-native.dylib: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit dynamically linked shared library x86_64] [arm64:Mach-O 64-bit dynamically linked shared library arm64]/Users/steve/repos/PowerShell-Native/src/powershell-unix/libpsl-native.dylib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64/Users/steve/repos/PowerShell-Native/src/powershell-unix/libpsl-native.dylib (for architecture arm64): Mach-O 64-bit dynamically linked shared library arm64

Needed to switch to vmimage for MacOS 10.15+ which has XCode12 to support building universal binary for M1 and x64.

Copy link
Contributor

@PaulHiginPaulHigin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@adityapatwardhanadityapatwardhan changed the title enable building universal (x64,arm64) binaries for MacOSEnable building universal (x64,arm64) binaries for MacOSMar 8, 2021
@adityapatwardhan
Copy link
Member

adityapatwardhan commented Mar 8, 2021

@SteveL-MSFT - can you verify that the release build succeeds?

@SteveL-MSFT
Copy link
MemberAuthor

@adityapatwardhan verified release build succeeds and library is universal

@adityapatwardhanadityapatwardhan merged commit 2ad0b58 into PowerShell:masterMar 9, 2021
@SteveL-MSFTSteveL-MSFT deleted the build-m1 branch March 10, 2021 22:51
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@SteveL-MSFT@adityapatwardhan@TravisEz13@PaulHigin