Skip to content

Fix static build with CMAKE_DEBUG_POSTFIX#5656

Merged
guhetier merged 1 commit intomicrosoft:mainfrom
Maiyu27:fix-static-postfix
Jan 14, 2026
Merged

Fix static build with CMAKE_DEBUG_POSTFIX#5656
guhetier merged 1 commit intomicrosoft:mainfrom
Maiyu27:fix-static-postfix

Conversation

@Maiyu27
Copy link
Copy Markdown
Contributor

@Maiyu27 Maiyu27 commented Dec 13, 2025

Description

This patch fixes an issue where building a static version of msquic with CMAKE_DEBUG_POSTFIX set fails during the linking step. Previously, the build would attempt to link a library file without the postfix, causing a fatal LNK1181 error. This change ensures the correct filename with the postfix is used for static builds.

Steps to reproduce

  1. Configure a Debug build with QUIC_BUILD_SHARED=OFF and CMAKE_DEBUG_POSTFIX=d.
  2. Attempt to build msquic.
  3. Observe the linking failure without this fix.

Expected behavior

The build should succeed using the correct library filename with the debug postfix.

Actual behavior

The build fails during linking because the library file without the postfix is referenced.

Notes

  • Verified locally.
  • Minor change in CMakeLists.txt to respect CMAKE_<CONFIG>_POSTFIX for static builds.

@Maiyu27 Maiyu27 requested a review from a team as a code owner December 13, 2025 10:16
@guhetier guhetier linked an issue Dec 16, 2025 that may be closed by this pull request
4 tasks
Comment thread src/bin/CMakeLists.txt
@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 16, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.25%. Comparing base (0b1071e) to head (12d5e17).
⚠️ Report is 35 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5656      +/-   ##
==========================================
- Coverage   85.05%   84.25%   -0.80%     
==========================================
  Files          60       60              
  Lines       18663    18663              
==========================================
- Hits        15873    15725     -148     
- Misses       2790     2938     +148     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@guhetier guhetier merged commit f1b22c1 into microsoft:main Jan 14, 2026
507 of 508 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Static build is not compatible with CMAKE_DEBUG_POSTFIX

3 participants