Skip to content
Open
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
2 changes: 2 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[target.'cfg(windows)']
linker = "linker-wrapper.bat"
23 changes: 23 additions & 0 deletions .cargo/linker-wrapper.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
@echo off
setlocal enabledelayedexpansion
for /f "usebackq delims=" %%i in (`rustc --print sysroot`) do set SYSROOT=%%i
if not defined SYSROOT (
echo Failed to determine Rust sysroot via `rustc --print sysroot`.>&2
exit /b 1
)
set TOOLCHAIN_LIB=%SYSROOT%\lib\rustlib\x86_64-pc-windows-msvc\lib
if not exist "%TOOLCHAIN_LIB%" (
echo Rust Windows target libraries not found at "%TOOLCHAIN_LIB%".>&2
echo Please ensure the `x86_64-pc-windows-msvc` target is installed.>&2
exit /b 1
)
set LLD=%SYSROOT%\bin\rust-lld.exe
if not exist "%LLD%" (
set LLD=%SYSROOT%\lib\rustlib\x86_64-pc-windows-msvc\bin\lld-link.exe
)
if not exist "%LLD%" (
echo Unable to locate `rust-lld.exe` inside the Rust toolchain.>&2
exit /b 1
)
"%LLD%" /LIBPATH:"%TOOLCHAIN_LIB%" %*
exit /b %ERRORLEVEL%
Loading