Explorar o código

add a rustbuild cargo feature for integration with rust-lang/rust

Jorge Aparicio %!s(int64=8) %!d(string=hai) anos
pai
achega
4bf128a84c
Modificáronse 1 ficheiros con 8 adicións e 1 borrados
  1. 8 1
      build.rs

+ 8 - 1
build.rs

@@ -407,8 +407,15 @@ fn main() {
             sources.remove(&["aeabi_cdcmp", "aeabi_cfcmp"]);
         }
 
+        let root = if env::var_os("CARGO_FEATURE_RUSTBUILD").is_some() {
+            Path::new("../../libcompiler_builtins")
+        } else {
+            Path::new(".")
+        };
+
+        let src_dir = root.join("compiler-rt/compiler-rt-cdylib/compiler-rt/lib/builtins");
         for src in sources.map.values() {
-            let src = Path::new("compiler-rt/compiler-rt-cdylib/compiler-rt/lib/builtins").join(src);
+            let src = src_dir.join(src);
             cfg.file(&src);
             println!("cargo:rerun-if-changed={}", src.display());
         }