You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
facade: libobs/CMakeLists.txt and cmake/rust.cmake: move platform conditionals into per-OS cmake files #888
Platform-conditional CMake in libobs (build config, not #if; not counted in the C/C++ totals). The tree already has libobs/cmake/os-{windows,macos,linux,freebsd}.cmake; the aim is to put per-OS sources, flags and public-header lists there so shared CMake is OS-free.
file:line
condition
what it does
proposed move
libobs/CMakeLists.txt:5
OS_WINDOWS AND NOT OBS_PARENT_ARCHITECTURE STREQUAL CMAKE_VS_PLATFORM_NAME
Windows multi-arch (ARM64EC/x64) early include+return
stays as bootstrap, or move into cmake/obs-version.cmake flow; document as exception
libobs/CMakeLists.txt:242
CMAKE_C_COMPILER_ID STREQUAL "MSVC"
/wd4996 on obs-data.c (compiler, not OS)
move to os-windows.cmake (set_source_files_properties)
libobs/CMakeLists.txt:283-291
OS_WINDOWS / OS_MACOS / OS_LINUX / OS_FREEBSD OR OS_OPENBSD
includes the per-OS file
already the target pattern; keep as the single dispatch
libobs/CMakeLists.txt:385-398
OS_WINDOWS / OS_MACOS
appends Windows/Apple util headers to public_headers
list(APPEND public_headers ...) in os-windows.cmake / os-macos.cmake
libobs/cmake/rust.cmake:9
OS_MACOS
cargo target triple per macOS arch
move into cmake/rust-os-macos.cmake
libobs/cmake/rust.cmake:39,48
OS_LINUX OR OS_FREEBSD OR OS_OPENBSD, OS_LINUX
Rust link libs / flags on unix
cmake/rust-os-nix.cmake
libobs/cmake/rust.cmake:51
OS_WINDOWS
Rust link libs on Windows (bcrypt/ntdll etc.)
cmake/rust-os-windows.cmake
libobs/cmake/rust.cmake:66
OS_MACOS
Rust link frameworks on macOS
cmake/rust-os-macos.cmake
Class: all (a) movable; none are (b) or (c). Counts: 8 rows, 11 conditions.
Test approach: configure-only checks per OS in the existing native build jobs (ci-full); on Linux compare cmake --build -t help / generated source lists before/after (diff must be empty). Rust-related rows are covered by the ENABLE_RUST_LIBOBS ON build.
Keep each move mechanical so upstream merges stay manageable. CI scoping then maps libobs/cmake/os-<os>.cmake and rust-os-<os>.cmake to platforms by path.
Move the Windows/Apple public_headers appends (libobs/CMakeLists.txt OS_WINDOWS/OS_MACOS block) into os-windows.cmake / os-macos.cmake as OBS_PUBLIC_HEADERS property appends. Check: the installed header set is unchanged (Linux configure diff empty). First PR today.
rust.cmake per-OS link/export blocks into rust-os-{nix,windows,macos}.cmake.
Decision: the /wd4996 row (libobs/CMakeLists.txt, the deprecation-warning block for build/libobs.ported-data+.h.c) stays in the shared file. It branches on CMAKE_C_COMPILER_ID (MSVC vs. GNU/Clang/AppleClang), not on the OS. It is one paired rule, and moving only the MSVC half to os-windows.cmake would split it with no gain in platform scoping. ci/test_libobs_cmake_facade.py only checks OS_* conditions, so nothing flags it.
The two remaining rows (the multi-arch bootstrap and the os-file dispatch) are the intended exceptions, so this issue closes when #1957 lands.
Activity
zackees commentedon Oct 23, 2026
Claiming: #888, one mechanical move per PR.
public_headersappends (libobs/CMakeLists.txtOS_WINDOWS/OS_MACOS block) intoos-windows.cmake/os-macos.cmakeasOBS_PUBLIC_HEADERSproperty appends. Check: the installed header set is unchanged (Linux configure diff empty). First PR today.rust.cmakeper-OS link/export blocks intorust-os-{nix,windows,macos}.cmake./wd4996row.zackees commentedon Oct 23, 2026
Progress on #888:
rust.cmakeper-OS blocks moved intorust-os-{nix,windows,macos}.cmake: build(libobs): move the Rust export and link setup into rust-os-<os>.cmake (#888) #1957 (stacked on build(libobs): append host public headers from os-<os>.cmake (#888) #1955)./wd4996row (libobs/CMakeLists.txt, the deprecation-warning block forbuild/libobs.ported-data+.h.c) stays in the shared file. It branches onCMAKE_C_COMPILER_ID(MSVC vs. GNU/Clang/AppleClang), not on the OS. It is one paired rule, and moving only the MSVC half toos-windows.cmakewould split it with no gain in platform scoping.ci/test_libobs_cmake_facade.pyonly checksOS_*conditions, so nothing flags it.The two remaining rows (the multi-arch bootstrap and the os-file dispatch) are the intended exceptions, so this issue closes when #1957 lands.
build(libobs): append host public headers from os-<os>.cmake (obs-rus…
test(ci): libobs rust.cmake dispatches host link setup to rust-os-<os…
build(libobs): move the Rust export and link setup into rust-os-<os>.…
build(libobs): move the Rust export and link setup into rust-os-<os>.…