From fce58d62a1c354b4185d40bd382a9340f9074efd Mon Sep 17 00:00:00 2001 From: Jake Shadle Date: Thu, 28 Sep 2017 19:32:52 +0200 Subject: [PATCH] fix(flag_check): Send flag to MSVC telling it not to link --- src/lib.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index ebcaa14..591678f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -342,6 +342,13 @@ impl Build { let compiler = cfg.try_get_compiler()?; let mut cmd = compiler.to_command(); command_add_output_file(&mut cmd, &obj, target.contains("msvc"), false); + + // We need to explicitly tell msvc not to link and create an exe + // in the root directory of the crate + if target.contains("msvc") { + cmd.arg("/c"); + } + cmd.arg(&src); let output = cmd.output()?;