Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Compile C/C++ dependencies (e.g. smartmontools) with /MT instead of /MD.
# Otherwise they link the C++ STL dynamically and the binary needs
# MSVCP140.dll, which isn't present on a clean Windows install.
# See framework_tool/build.rs for how vcruntime is linked statically.
[target.'cfg(all(windows, target_env = "msvc"))']
rustflags = ["-C", "target-feature=+crt-static"]
13 changes: 13 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,19 @@ jobs:
- name: Check if Windows tool can start
run: target/release/framework_tool.exe --help

# The runner has the VC++ redistributable installed, a clean Windows doesn't
- name: Check Windows tool doesn't need VC++ redistributable
shell: pwsh
run: |
$vs = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath
$dumpbin = Get-ChildItem "$vs\VC\Tools\MSVC\*\bin\Hostx64\x64\dumpbin.exe" | Select-Object -First 1
$deps = & $dumpbin /dependents target/release/framework_tool.exe
$deps
if ($deps -match '(?i)(msvcp|vcruntime)\d+') {
Write-Error "framework_tool.exe depends on the VC++ redistributable"
exit 1
}

# Upload release build so that vcruntime is statically linked
- name: Upload Windows App
uses: actions/upload-artifact@v6
Expand Down
Loading