Skip to content

Commit 1d9be21

Browse files
committed
fix(build): static-link MinGW package-smoke to fix CI hang
The installed-package smoke exe dynamically linked the MinGW runtime; the Windows runner resolves a mismatched libstdc++/libgcc/winpthread on PATH, hanging the exe at startup/teardown (same root cause as the earlier test-exe STATUS_ENTRYPOINT_NOT_FOUND). Embedding the GCC runtime makes it self-contained and PATH-independent, without changing what the smoke verifies. Verified locally: exe carries no external GCC runtime DLL and exits 0.
1 parent 3234450 commit 1d9be21

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

tests/package_smoke/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,14 @@ find_package(DetourModKit REQUIRED)
1111
add_executable(dmk_package_smoke main.cpp)
1212
target_link_libraries(dmk_package_smoke PRIVATE DetourModKit::DetourModKit)
1313

14+
# Statically link the GCC runtime on MinGW. This is a CI-runner workaround, not a consumer recommendation: a
15+
# Windows runner can resolve a mismatched libstdc++ / libgcc / libwinpthread on PATH than the toolchain that built
16+
# the exe, which makes the smoke binary hang at startup/teardown. Embedding the runtime makes it self-contained so
17+
# the installed-package check is PATH-independent, without changing what is verified here (find_package wiring and
18+
# the exported C++23 requirement).
19+
if(MINGW)
20+
target_link_options(dmk_package_smoke PRIVATE -static -static-libgcc -static-libstdc++)
21+
endif()
22+
1423
enable_testing()
1524
add_test(NAME dmk_package_smoke COMMAND dmk_package_smoke)

0 commit comments

Comments
 (0)