]> git.lizzy.rs Git - rust.git/blobdiff - y.rs
Move Object creation into metadata.rs
[rust.git] / y.rs
diff --git a/y.rs b/y.rs
index 55457745d25b59c7b6ddcd8ce5b7b712d30cf03a..26605003c42008cd8c3baf101e622e5ea4497013 100755 (executable)
--- a/y.rs
+++ b/y.rs
@@ -15,8 +15,8 @@
 //! for example:
 //!
 //! ```shell
-//! $ rustc y.rs -o build/y.bin
-//! $ build/y.bin
+//! $ rustc y.rs -o y.bin
+//! $ ./y.bin
 //! ```
 //!
 //! # Naming
@@ -31,6 +31,8 @@
 mod build_backend;
 #[path = "build_system/build_sysroot.rs"]
 mod build_sysroot;
+#[path = "build_system/config.rs"]
+mod config;
 #[path = "build_system/prepare.rs"]
 mod prepare;
 #[path = "build_system/rustc_info.rs"]
@@ -114,6 +116,8 @@ fn main() {
 
     let host_triple = if let Ok(host_triple) = std::env::var("HOST_TRIPLE") {
         host_triple
+    } else if let Some(host_triple) = crate::config::get_value("host") {
+        host_triple
     } else {
         rustc_info::get_host_triple()
     };
@@ -123,6 +127,8 @@ fn main() {
         } else {
             host_triple.clone() // Empty target triple can happen on GHA
         }
+    } else if let Some(target_triple) = crate::config::get_value("target") {
+        target_triple
     } else {
         host_triple.clone()
     };
@@ -135,12 +141,12 @@ fn main() {
         process::exit(1);
     }
 
-    let cg_clif_dylib = build_backend::build_backend(channel);
+    let cg_clif_build_dir = build_backend::build_backend(channel, &host_triple);
     build_sysroot::build_sysroot(
         channel,
         sysroot_kind,
         &target_dir,
-        cg_clif_dylib,
+        cg_clif_build_dir,
         &host_triple,
         &target_triple,
     );