Repository navigation
build: Cross-compile libobs for Windows and macOS from any host via soldr - #1075
Merged
Merged
Conversation
…oldr cmake/cross/ is a standalone CMake project that compiles libobs for another OS with the LLVM and SDK soldr provisions (Apple SDK, or the xwin MSVC CRT + Windows SDK) and the same prebuilt dependencies the real build uses (CMakePresets.json -> .deps/, via buildspec_common). It compiles every source that OS builds, both the C build's ported files and the Rust build's C halves, and links nothing. A configured OBS build gets cross-win-x64, cross-mac-arm64, cross-mac-x64 and cross-all. cmake/common/soldr.cmake finds soldr on PATH or downloads the version CI pins (SHA256-checked; ci/test_soldr_pin.py keeps it equal to the setup-soldr version: in the workflows). It runs soldr toolchain prepare and finds LLVM and the SDK under soldr's root; that becomes soldr cc --target <triple> once soldr exposes the Apple and MSVC targets. No win-arm64: util/threading-windows.h (public) uses MSVC-only ARM64 intrinsics clang lacks. libobs's file lists move into libobs/cmake/sources.cmake (common, ported, Rust-only, and per-host sources and obs-host no-ops), read by libobs/CMakeLists.txt, cmake/os-<os>.cmake and the cross project, so both compile the same files. Per-OS lists are unchanged. validate.sh derives the ported objects (46) from it. .deps/ is git-ignored. Local: win-x64, mac-arm64 and mac-x64 compile libobs with 0 errors; their warnings are all in code master already has. Refs #1051, #1065
Member
Author
|
Rebased onto master (c4e9442). #1069 landed, so its two commits are dropped, and the branch now carries only the cross-compile commit. The rebase had no conflicts. Checked after the rebase:
Not built locally. |
zackees
force-pushed
the
infra/cross-compile-targets
branch
from
October 16, 2026 11:14
891519f to
c4e9442
Compare
This was referenced Oct 16, 2026
This was referenced Oct 30, 2026
Closed
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #1051, #1065. Stacked on #1069: its two commits show here until it merges.
What
A CMake cross-compile check for libobs. It compiles libobs for Windows and macOS on any host, without a Windows or macOS runner.
Usage:
What each part does:
cmake/cross/: a standalone project that compiles every libobs source the target OS builds, including the C build's ported files and the Rust build's C halves. It links nothing.CMakePresets.json→.deps/).-DOBS_CROSS_WERROR=ONmakes them errors.cmake/common/soldr.cmake:PATH, or downloads the version CI pins and checks its SHA256.ci/test_soldr_pin.pykeeps that pin equal to the workflows'.soldr toolchain prepare, then finds LLVM and the SDK under soldr's root. A TODO says to switch tosoldr cc --target <triple>once soldr exposes the Apple and MSVC targets.libobs/cmake/sources.cmake: libobs's file lists move here, read by both the real build and the cross project. The per-OS lists are unchanged (checked file by file against the old lists).validate.sh: derives the ported objects (still 46) fromsources.cmake..deps/: now git-ignored.win-arm64:util/threading-windows.h, a public header, uses MSVC-only ARM64 intrinsics that clang lacks.Verified locally
win-x64: 0 errors, 56 warnings.mac-arm64: 0 errors, 40 warnings.mac-x64: 0 errors, 40 warnings.PATHlookup disabled, CMake fetched soldr 0.9.33, verified the SHA256, and the binary ran.ci/Python suite: 506 tests pass.