Fix hardcoded path to link.exe

This commit is contained in:
UK992 2017-01-31 23:19:52 +01:00
parent fb7f65fc57
commit a5ce6304b1
2 changed files with 4 additions and 2 deletions

View file

@ -37,7 +37,9 @@ fn main() {
// for reasons that I don't understand. If we just give // for reasons that I don't understand. If we just give
// link.exe, it tries to use script-*/out/link.exe, which of // link.exe, it tries to use script-*/out/link.exe, which of
// course does not exist. // course does not exist.
build.define("CMAKE_LINKER", "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\bin\\amd64\\link.exe"); let link = std::process::Command::new("where").arg("link.exe").output().unwrap();
let link_path: Vec<&str> = std::str::from_utf8(&link.stdout).unwrap().split("\r\n").collect();
build.define("CMAKE_LINKER", link_path[0]);
} }
build.build(); build.build();

View file

@ -2,7 +2,7 @@
SET VS_VCVARS=%VS140COMNTOOLS%..\..\VC\vcvarsall.bat SET VS_VCVARS=%VS140COMNTOOLS%..\..\VC\vcvarsall.bat
IF EXIST "%VS_VCVARS%" ( IF EXIST "%VS_VCVARS%" (
IF NOT DEFINED VisualStudioVersion ( IF NOT DEFINED Platform (
IF EXIST "%ProgramFiles(x86)%" ( IF EXIST "%ProgramFiles(x86)%" (
call "%VS_VCVARS%" x64 call "%VS_VCVARS%" x64
) ELSE ( ) ELSE (