-
-
Notifications
You must be signed in to change notification settings - Fork 8.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mac-virtualcam: Build a universal x86_64+arm64 binary for M1 Macs #3779
Conversation
@@ -1,3 +1,6 @@ | |||
# Universal build for Apple Silicon | |||
set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to https://cmake.org/cmake/help/v3.5/variable/CMAKE_OSX_ARCHITECTURES.html
The value of this variable should be set prior to the first project() or enable_language() command invocation because it may influence configuration of the toolchain and flags. It is intended to be set locally by the user creating a build tree.
cc @PatTheMav |
.github/workflows/main.yml
Outdated
@@ -34,6 +34,11 @@ jobs: | |||
uses: actions/checkout@v2.3.3 | |||
with: | |||
submodules: 'recursive' | |||
# This will probably not be necessary once GitHub actions | |||
# uses an Xcode that supports macOS arm64 by default. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In fact, we should probably just sit on this since it looks like this will be automatically fixed on Nov 30: actions/runner-images#2056
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@johnboiles Small reminder to remove this if it is truly not required anymore by tomorrow.
Looks like Azure is failing because it doesn't have the most recent Xcode. Some quick Googling didn't turn up any info about setting a different Xcode version, but I bet they update their Xcode soon, so one strategy is to just wait until we do, and then merge this PR. |
azure-pipelines.yml
Outdated
@@ -32,6 +32,8 @@ jobs: | |||
steps: | |||
- script: git submodule update --init --recursive | |||
displayName: 'Checkout Submodules' | |||
- script: sudo xcode-select -s "/Applications/Xcode_12.2.app" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't track down a date for when Azure is switching to Xcode 12.2 by default.
Ok fixed Azure too. My recommendation is to merge this before we ship an OBS release with the macOS Virtualcam so that users on Apple Silicon can use this plugin in universal apps. But if it's going to be a couple weeks before we ship an OBS release, we could hold on merging this and it's possible we'll be able to revert the CI changes (because GitHub and Azure make Xcode 12.2 the default). |
Could we move this to the 26.1 milestone so that the built-in virtualcam can be used? |
Build failed -- Xcode 12.2 must not have propagated to the actions runners yet. |
Also +1 to @wookayin's comment. That might help us avoid unnecessary support inquiries from folks on M1 Macs and also will allow me to archive github.com/obs-mac-virtualcam (so people don't get confused about which to use) |
As stated in actions/runner-images#2056, propagation of Xcode 12.2 might take 2-3 days. |
Yep, i'm just over eager :) |
Please squash your commits & correctly prefix them. |
If I bring back the manual xcode 12.2 selection are we cool with going ahead and merging this? If so I'll go ahead and squash commits and we can merge. Then at some point when GH updates the action runners to have an arm64 compatible xcode by default we can remove those CI steps in a different PR. |
In the meantime I'll try Azure also to see if they've updated their default Xcode |
a318199
to
a8f1c42
Compare
Ok the whole build worked (except for linux which is probably a flakey build). Removing the CI changes and rebasing/squashing! |
🎉 |
@johnboiles Thank you for the quick update! :) ❤️ |
Description
This patch updates the DAL part of the macOS Virtualcam plugin to be a fat binary that includes both x86_64 and arm64 binaries.
Motivation and Context
This enables universal apps running on Apple Silicon to use the plugin (even while OBS is running as x86_64 under Rosetta).
This patch can probably be removed once all of OBS supports Apple Silicon (since I assume something like this will be the default for the entire build).
How Has This Been Tested?
There's been some testing in my Repo with a similar change. See:
johnboiles/obs-mac-virtualcam#239
johnboiles/obs-mac-virtualcam#240
Types of changes
Checklist: