fix(libmoq): declare the full Windows system-lib set for C consumers#1792
Conversation
When an external linker consumes libmoq.a on Windows, cargo can't inject the system libraries Rust's std/deps need, so they must be declared in the CMake config. The find_package config (moq-config.cmake.in) listed only ws2_32/userenv/bcrypt/ntdll; add dbghelp/advapi32/legacy_stdio_definitions to match `cargo rustc -- --print native-static-libs`. Mirror the same set on the add_subdirectory `moq` target so both consumption paths link cleanly (fixes __imp_NtCreateNamedPipeFile and friends when linking from C++ on Windows). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughTwo CMake files for the 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches✨ Simplify code
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
When an external linker consumes
libmoq.aon Windows, cargo cannot inject the system libraries Rust std/deps require, so they must be declared in the CMake config consumers link against.The
find_packageconfig (rs/libmoq/cmake/moq-config.cmake.in) listed onlyws2_32/userenv/bcrypt/ntdll; this addsdbghelp/advapi32/legacy_stdio_definitionsto matchcargo rustc -- --print native-static-libs. The same set is mirrored onto theadd_subdirectorymoqtarget so both consumption paths (released config + in-tree) link cleanly.Surfaced while linking
libmoq.ainto a C++ consumer on Windows (__imp_NtCreateNamedPipeFileand similar unresolved externals).(Written by Claude)