Skip to content

Cmake: Sets minimum macOS SDK and XCode to 26.1. #13406

Open
danrossi wants to merge 1 commit intoobsproject:masterfrom
danrossi:macos-build-req-fix
Open

Cmake: Sets minimum macOS SDK and XCode to 26.1. #13406
danrossi wants to merge 1 commit intoobsproject:masterfrom
danrossi:macos-build-req-fix

Conversation

@danrossi
Copy link
Copy Markdown

@danrossi danrossi commented May 6, 2026

Description

There is a build issue in macOS with errors if the Xcode and Swift version is too old. This cmake config change sets the minimum macOS SDK and XCode version to 26.1. To match the CI mac build environment. XCode 16.3 builds but best to match the CI build system. This requires macOS 15.6 and above.

I am unable to find the docs for building the source.

Motivation and Context

Related: #13384

This fixes a build error when using macOS 14 and Xcode 16.1.

How Has This Been Tested?

cmake --preset macos
cd build_macos
xcodebuild                                                 \
  -configuration RelWithDebInfo \
  -scheme obs-studio                                       \
  -parallelizeTargets                                      \
  -destination "generic/platform=macOS,name=Any Mac"

Types of changes

Bug fix (non-breaking change which fixes an issue)

Checklist:

  • [ x] I have read the contributing document.
  • My code has been run through clang-format.
  • [ x] My code follows the project's style guidelines
  • [ x] My code is not on the master branch.
  • [ x] My code has been tested.
  • [ x] All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

@danrossi
Copy link
Copy Markdown
Author

danrossi commented May 6, 2026

The checks is still happening. However with an XCode Universal 26.1. A Universal build can be made on arm64. I am not sure what XCode the x86 has.

OBS builds a universal build. So any XCode 26.1 and above that doesn't say Apple Silicon is the Universal XCode. It needs to be manually installed via this site or Xcodes. As the Apple Store was only offering 16.1.

https://xcodereleases.com/

@WizardCM WizardCM added kind/enhancement Enhancements are not bugs or new features but can improve usability or performance. platform/macos Categorizes issue or PR as affecting macOS specifically kind/bug Categorizes issue or PR as related to a bug. and removed kind/enhancement Enhancements are not bugs or new features but can improve usability or performance. labels May 6, 2026
@Fenrirthviti
Copy link
Copy Markdown
Member

We don't officially support x86 anymore anyway, so no need to worry about what's going on there (if anything).

@jcm93
Copy link
Copy Markdown
Contributor

jcm93 commented May 7, 2026

XCode 16.3 builds but best to match the CI build system

Usual caveat here that ultimately these decisions rest with project maintainers, but, that said, I don't think I see any reason to set the minimum required version to compile anywhere beyond the minimum version that actually builds and runs successfully (in this case, Xcode 16.3).

The last PR that you closed (#13384) may have even been a more appropriate fix, since a single syntactical trailing comma in a parameter list is the only thing preventing the project from compiling under Swift 6.0 / Xcode 16.1.

It's certainly good practice to proactively use the latest toolchains when they become available, to get ahead of any issues that may exist with them, and also to take advantage of things like performance improvements, but requiring them for all developers is a different matter.

Swift 6.0, C++17 and the macOS 15 SDK are all very real requirements for OBS, and very real failures happen if you attempt to use any prior version of those toolchains or standards. I'm not sure it makes sense to set the minimum required SDK version any higher than these required versions if there is no known failure that happens on lower versions, or defects observed in the build.

@danrossi
Copy link
Copy Markdown
Author

danrossi commented May 7, 2026

The mac builds are done with the Universal XCode 26.1. So if there is no issues running with macOS 14 I thought it's best to just update the requirements in the build system. I had to upgrade to macOS 15 to build properly under XCode 16.3 so can't check in macOS 14 now.

Did you want me to fix the trailing comma again or keep this PR. I was not sure what to do.

@jcm93
Copy link
Copy Markdown
Contributor

jcm93 commented May 7, 2026

On your previous PR, I advised:

I would leave this open until maintainers establish which course is correct.

That still applies; I am not sure why you closed it.

Now that this PR exists as well, I suppose I might change it to require Xcode 16.3 (macOS 15.4 SDK). Then it would represent a separate and distinct resolution for the original issue.

And again, it could be that neither resolution is appropriate and the project will decide something else entirely is correct. These sorts of chores/changes are often better left in the hands of actual maintainers for that reason; it's not usually easy or reasonable for someone newer to a project to know all of the variables that factor into its final choice for something like an SDK or OS requirement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Categorizes issue or PR as related to a bug. platform/macos Categorizes issue or PR as affecting macOS specifically

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants