Make rust build pass LLVM_RUSTLLVM to C++ compiler

This commit is contained in:
Cameron Hart 2016-07-29 23:09:32 +10:00
parent ce50bedd8c
commit fc210a8994
2 changed files with 8 additions and 0 deletions

View file

@ -199,6 +199,10 @@ pub fn rustc<'a>(build: &'a Build, target: &str, compiler: &Compiler<'a>) {
if !build.unstable_features {
cargo.env("CFG_DISABLE_UNSTABLE_FEATURES", "1");
}
// Flag that rust llvm is in use
if build.config.target_config.get(target).is_none() {
cargo.env("LLVM_RUSTLLVM", "1");
}
cargo.env("LLVM_CONFIG", build.llvm_config(target));
if build.config.llvm_static_stdcpp {
cargo.env("LLVM_STATIC_STDCPP",

View file

@ -112,6 +112,10 @@ fn main() {
cfg.flag(&flag);
}
if env::var_os("LLVM_RUSTLLVM").is_some() {
cfg.flag("-DLLVM_RUSTLLVM");
}
cfg.file("../rustllvm/ExecutionEngineWrapper.cpp")
.file("../rustllvm/PassWrapper.cpp")
.file("../rustllvm/RustWrapper.cpp")