build(runtime): compile and link the libraries with MSVC #8
No reviewers
Labels
No labels
accessibility
bug
ci
docs
documentation
duplicate
enhancement
fixes issue
good first issue
help wanted
invalid
library request
libs
needs rebase
question
relinker
stale
tools
unblocks title
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Dark3581--AnyBox!8
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/8/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?
@CaseReed on GitHub · 2026-11-21 05:23 UTC · original
CaseReed:fix/msvc-build→main· +8 −8 · 5 files · 1 commits · merged 2026-11-21 06:59 UTCWhat
The full build fails with MSVC, which
docs/dev/BUILD.mdlists as supported; CI only builds the libraries with MinGW. This makes it compile and link, with no behaviour change:AbxApi.hppandRuntime.cpp: MSVC rejects[[noreturn]]afterextern "C" __declspec(...). The attribute moves after the function name, a standard position GCC accepts too.Runtime.cpp:std::mincollides with theminmacro from<windows.h>. The call is parenthesised. It is the onlystd::min/std::maxseen by<windows.h>, so noNOMINMAXin CMake.ab_gameinput.dllandab_xaudio2.dll:link.exeresolves a forwarder's target at link time, so the two forward-only libraries need the Windows SDK import libraries (gameinput.lib,xaudio2.lib). They are linked for MSVC only, through the existingLINKargument.ab_kernelx.dllalready linked becausekernel32.libis a default library.BUILD.mdstates the Windows SDK requirement.The
LINKvalue is a generator expression rather than anif(MSVC)block with two calls, becausetools/stubgen.pyedits the firstanybox_add_xdll(it finds and would addInventory.cppto one branch only. Happy to switch if you prefer the block.Tested
Windows 11, CMake 4.4.4, Ninja 1.13.2, Windows SDK 10.0.26100, clean build directories.
dumpbin /exports:ab_gameinput.dllforwards 1 export togameinput,ab_xaudio2.dll6 toxaudio2_9,ab_kernelx.dll39 tokernel32.dumpbin /dependents:ab_gameinput.dllandab_xaudio2.dllhave the same load-time dependencies as the libraries withoutLINK; neithergameinput.dllnorxaudio2_9.dllis added.python tools/check_conventions.py: ok.Not tested locally: the MinGW full build (no GCC on this machine), so this relies on CI. A minimal snippet with the new
[[noreturn]]placement and(std::min)compiles without warnings under-std=c++20 -Wall -Wextra -Werrorwith MinGW GCC 13.1, 15.2 and 16.2 on Compiler Explorer. Only SDK 10.0.26100 was checked; I don't know the oldest SDK that shipsgameinput.lib.Observed, not changed: under MSVC
e2e_crashpasses but skips the crash report check (no report written), the gap already recorded indocs/dev/debt/runtime.mdfor the GitHub runner (#7).Checklist
main; no other open PR implements the same functionspython tools/check_conventions.pypasses (no comments in code, one declaration per export, Conventional Commit subjects)AbxNotImplemented/AbxUnsupported); silent stubs are listed under Silent stubs through a debt fragment (no function body changed)docs/dev/debt/changes/<branch>.md(none added)🤖 Generated with Claude Code
@Dark3581 on GitHub · 2026-11-21 06:59 UTC · original · approved these changes
Reviewed — looks good
Nothing blocks this change. MSVC now builds the libraries, and the MinGW build is unchanged.
What I ran
Reviewed head
498e912. Built it on its own with MinGW (WinLibs GCC 15.2 UCRT, Ninja, Release) on Windows 10, from a clean build directory.Results
tools/check_conventions.pytools/debt_fold.py --checkFindings
Blocking
None.
Non-blocking
build.ymlwould fix that; it doesn't belong in this PR.Not verified
The MSVC build and the claim about the oldest Windows SDK that ships
gameinput.lib.To get this to a good state
Nothing is required. Thanks for the clear write-up of each error.