Skip to content

fix(tests): statically link MinGW sandbox helper runtime - #330

Closed
sgt57 wants to merge 1 commit into
Project-LemonLime:masterfrom
sgt57:fix/mingw-sandbox-helper-entry-point
Closed

sgt57 wants to merge 1 commit into
Project-LemonLime:masterfrom
sgt57:fix/mingw-sandbox-helper-entry-point

Conversation

@sgt57

@sgt57 sgt57 commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

本 PR 内容与 #326 相同。或许因为我的描述不够清晰,#326 被 close 了。但我认为这个修复是必要的,故新开一个 PR。

因为 sandbox-helper 不继承环境变量,Path 中的运行库不会被传递到沙箱内。这不是个人环境/配置导致的问题。如果不启用静态链接,找不到运行库将普遍地发生。为了解决这个问题,tests/windows-sandbox/CMakeLists.txt 为 MSVC 专门配置了

if(MSVC)
    set_property(TARGET sandbox-helper PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
endif()

来静态链接 CRT。出于同样的考虑,本 PR 为 mingw 启用了 -static。

@sgt57

sgt57 commented Nov 8, 2026

Copy link
Copy Markdown
Contributor Author

Included in #331.

@sgt57 sgt57 closed this Nov 8, 2026
@sgt57
sgt57 deleted the fix/mingw-sandbox-helper-entry-point branch November 27, 2026 00:56
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.

1 participant