about summary refs log tree commit diff
path: root/src/bootstrap/native.rs
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2018-03-05 09:47:54 -0800
committerAlex Crichton <alex@alexcrichton.com>2018-03-09 07:29:08 -0800
commitbe902e7168505954b85e1bbb35322f8df8a29c19 (patch)
tree1c68f40b0ae7d2c2b8a6e51064e18ab1dc601ca1 /src/bootstrap/native.rs
parentfedce67cd21dc08ece5a484fe1a060346acac98a (diff)
downloadrust-be902e7168505954b85e1bbb35322f8df8a29c19.tar.gz
rust-be902e7168505954b85e1bbb35322f8df8a29c19.zip
rustbuild: Fix MSBuild location of `llvm-config.exe`
For LLD integration the path to `llvm-config` needed to change to inside the
build directory itself (for whatever reason) but the build directory is
different on MSBuild than it is on `ninja` for MSVC builds, so the path to
`llvm-config.exe` was actually wrong and not working!

This commit removes the `Build::llvm_config` function in favor of the source of
truth, the `Llvm` build step itself. The build step was then updated to find the
right build directory for MSBuild as well as `ninja` for where `llvm-config.exe`
is located.

Closes #48749
Diffstat (limited to 'src/bootstrap/native.rs')
-rw-r--r--src/bootstrap/native.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/bootstrap/native.rs b/src/bootstrap/native.rs
index 7888f0b938d..242f09c3723 100644
--- a/src/bootstrap/native.rs
+++ b/src/bootstrap/native.rs
@@ -81,11 +81,14 @@ impl Step for Llvm {
 
         let (out_dir, llvm_config_ret_dir) = if emscripten {
             let dir = build.emscripten_llvm_out(target);
-            let config_dir = dir.join("build/bin");
+            let config_dir = dir.join("bin");
             (dir, config_dir)
         } else {
-            (build.llvm_out(target),
-                build.llvm_out(build.config.build).join("build/bin"))
+            let mut dir = build.llvm_out(build.config.build);
+            if !build.config.build.contains("msvc") || build.config.ninja {
+                dir.push("build");
+            }
+            (build.llvm_out(target), dir.join("bin"))
         };
         let done_stamp = out_dir.join("llvm-finished-building");
         let build_llvm_config = llvm_config_ret_dir