Skip to content

Conversation

@Maiyu27
Copy link

@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=ON 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
endif()
else()
add_library(msquic_static STATIC static/empty.c)
set_target_properties(msquic_static PROPERTIES OUTPUT_NAME "${QUIC_LIBRARY_NAME}${CMAKE_DEBUG_POSTFIX}")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The bug / PR description mentions the issue when QUIC_BUILD_SHARED=ON, but this is in the QUIC_BUILD_SHARED=OFF path. A similar change might be needed above to add the postfix

@codecov
Copy link

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 5 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.

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

2 participants