Repository navigation
libobs: Unity groups with one precompiled header each (BUILD.md) - #1147
Merged
Merged
Conversation
foo.c -> foo.c.h, foo.m -> foo.m.h, in place; the obs-host no-op capabilities obs-host/noop/<cap>.c -> <cap>.hpp (headers each host file includes). git mv only, no content change: the unity groups and their precompiled headers follow. util/windows/obfuscate.c stays: it is OBS::obfuscate's interface source, compiled into plugins too.
libobs/build/ holds the groups (libobs.<name>+.h.c/.h.m) and their shared precompiled headers (<family>.pch.h). Every implementation file includes exactly its group's header and nothing else: its includes, the feature macros that precede them and their platform conditionals moved there. Families split where dependencies differ: FFmpeg (media), util/ alone (the C oracle compiles those files on their own), the Rust-ported files, each platform, optional features (PulseAudio, Wayland, GIO, portal shortcuts), macros that must come first (_FILE_OFFSET_BITS, _GNU_SOURCE), lean vs full <windows.h>, and the crash handler (OBS_VERSION on the command line). The obs-host no-op capabilities are headers each host file includes at its end. cmake/common/groups.cmake: grouped targets always build unity + PCH; per language the most shared header is precompiled, other families and groups with their own compile options (-fobjc-arc) include theirs textually. A target compiling an implementation file directly (the C tests) gets it in its language with the owner's include directories and definitions. ci/test_build_groups.py (in ./lint) enforces the groups and the one-include rule. BUILD.md describes it: C-family files end in .h and C++-family in .hpp, since clang-format formats a .hpp as C++. Paths updated in the C tests' CMake, the C oracle (now _DEFAULT_SOURCE on Unix, as gnu17 has, since a family header brings threading.h to all its files), ci/ tooling, validate.sh and the ratchet baseline.
This was referenced Oct 17, 2026
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.
Converts libobs to the BUILD.md build. libobs is the first component; the others follow in this order:
libobs-*,shared/,plugins/,frontend/.Commits
git mv, 134 files, all R100.foo.cbecomesfoo.c.h, andfoo.mbecomesfoo.m.h.obs-host/noop/<cap>.hpp.obfuscate.ckeeps its name: it is an interface source that plugins compile too.libobs/build/libobs.<name>+.h.cand+.h.m, with shared precompiled headers<family>.pch.h._FILE_OFFSET_BITSand_GNU_SOURCE;<windows.h>;OBS_VERSIONon the command line.cmake/common/groups.cmake. Grouped targets always build with unity and PCH on.-fobjc-arc.ci/test_build_groups.py(part of./lint) enforces group membership and the one-include rule..h: clang-format formats a.hppas C++, whereprivateandneware keywords.ci/,validate.shand the ratchet baseline. The C oracle now sets_DEFAULT_SOURCEon Unix, as gnu17 does.Verified locally, on this tree or on the same libobs changes
cmake/crossmacOS arm64 and Windows x64: clean, on this tree../lint: clean, on this tree. clang-format covers the.c.hfiles.test_video_iofailed once under load 50+, then passed 3 out of 3 runs on its own../unittestTier 2, which is left to PR CI. Its earlier run found two problems, both fixed here: GIO in the Wayland header, anddstr-libcin the core header.The full Windows/macOS run is dispatched separately, because PR CI does not build those apps.