build: compile four checks' shared sources once #1814
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!1814
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1814/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@tedin7 on GitHub · 2026-11-24 19:05 UTC · original
tedin7:x2w-cmake-shared-objs→main· +25 −9 · 1 files · 1 commits · closed without mergingBuild-time only. No target, CTest name, source file or test behavior changes.
What
Four sources were compiled once per executable that links them, with the same C++ standard, include directories (same order), definitions and runtime. Each is now an
OBJECTlibrary whose objects the executables take with$<TARGET_OBJECTS:...>, the pattern the file already uses forera_physical_lenient.tests/d3d12x_device_check.cppd3d12x_device_check,d3d12x_device_struct_return_controltests/startup_stream_setup.cppstartup_stream_consumer,startup_stream_depthsrc/startup_stubs/audio_sink.cppstartup_audio_output,startup_audio_pacingtests/desktop_gpu.cppd3d12x_compute_list_check,d3d12x_graphics_list_checkFour compiles fewer in each configuration, out of about 800. The saving is a few seconds of compiler time at most (D3D12, DXGI and WASAPI headers are the cost). I did not measure it, and I am not claiming a wall-clock number.
What I left alone, and why
tests/desktop_gpu.cppinstartup_dump_fence_check,startup_nv12_drawandstartup_plane_refreshwould save two more compiles. Their lines sit next to additions in #1641 and #1806, which conflicted when I tried it, so they are unchanged.src/startup_stubs/d3d12_xs_device.cppis in #1752.xmem_shim,d3d12_xs_shim,cpu_*providers, the archive codec) get a different<target>_EXPORTSdefinition per target, so their command lines are not identical.startup_gamesave_lock_errors_keep,cpu_startup_exe_*,xmem_shim_test_controls,d3d12_xs_rangewith different include directories) are not shared.Checks
git merge-treeof this branch against all 88 open PRs that touchCMakeLists.txt, and against #1740. For every PR the set of conflicting files and the number of conflict hunks inCMakeLists.txtmatch what the same PR already has againstorigin/mainalone (56 merge cleanly, 32 already conflict withmain). No new conflict, including #1173, #1752 and #1789. The PRs that edittests/startup_stream_setup.cpportests/desktop_gpu.h(#1808, #1726, #1779, #1568, #713) change source content only, not compile flags.$<TARGET_OBJECTS:...>in executables, same include-directory order) configured and built with CMake 3.31 and Ninja on Linux: 24 compiles before this change, 20 after, all 11 executables link. The Ninja compile lines for each shared source were identical across their targets before the change.git diff --check origin/main...HEAD,python3 -B tests/docs_links_check.pyandpython3 -B tests/bidi_controls_check.pypass.Not verified
OBJECTlibrary's own; I expect no difference but have not seen it on MSVC.AI-assisted; commands listed were executed locally.
@tedin7 on GitHub · 2026-11-24 19:14 UTC · original
Closing this draft for now to help keep the open PR queue manageable; the branch stays preserved on the fork so it can be reopened once the queue clears.
Pull request closed