]> git.lizzy.rs Git - rust.git/commitdiff
rustbuild: allow configuring llvm version suffix
authorMarc-Antoine Perennou <Marc-Antoine@Perennou.com>
Thu, 6 Sep 2018 09:06:32 +0000 (11:06 +0200)
committerMarc-Antoine Perennou <Marc-Antoine@Perennou.com>
Fri, 7 Sep 2018 15:33:45 +0000 (17:33 +0200)
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
config.toml.example
src/bootstrap/config.rs
src/bootstrap/native.rs

index 35f69cd05b607098028140e8edcb79000ae0c003..087dc418e2dce9a02d13cf941dfbd6cee1dc6536 100644 (file)
 # passed to prefer linking to shared libraries.
 #link-shared = false
 
+# When building llvm, this configures what is being appended to the version.
+# If absent, we let the version as-is.
+#version-suffix = "-rust"
+
 # On MSVC you can compile LLVM with clang-cl, but the test suite doesn't pass
 # with clang-cl, so this is special in that it only compiles LLVM with clang-cl
 #clang-cl = '/path/to/clang-cl.exe'
index bf4d39c4947e51202945a14076f32dc89aefc998..70b21a1567b0fa8e657db770a04dd6f857df7a65 100644 (file)
@@ -86,6 +86,7 @@ pub struct Config {
     pub llvm_targets: Option<String>,
     pub llvm_experimental_targets: String,
     pub llvm_link_jobs: Option<u32>,
+    pub llvm_version_suffix: Option<String>,
 
     pub lld_enabled: bool,
     pub lldb_enabled: bool,
@@ -256,6 +257,7 @@ struct Llvm {
     experimental_targets: Option<String>,
     link_jobs: Option<u32>,
     link_shared: Option<bool>,
+    version_suffix: Option<String>,
     clang_cl: Option<String>
 }
 
@@ -516,6 +518,7 @@ pub fn parse(args: &[String]) -> Config {
             config.llvm_experimental_targets = llvm.experimental_targets.clone()
                 .unwrap_or("WebAssembly;RISCV".to_string());
             config.llvm_link_jobs = llvm.link_jobs;
+            config.llvm_version_suffix = llvm.version_suffix.clone();
             config.llvm_clang_cl = llvm.clang_cl.clone();
         }
 
index caf38d766f54effb2e96b65b7c9d92b24d80b265..828a7d14c04370f8bb841e651a9a7a7a4e4f5643 100644 (file)
@@ -239,6 +239,10 @@ fn run(self, builder: &Builder) -> PathBuf {
             cfg.define("LLVM_NATIVE_BUILD", builder.llvm_out(builder.config.build).join("build"));
         }
 
+        if let Some(ref suffix) = builder.config.llvm_version_suffix {
+            cfg.define("LLVM_VERSION_SUFFIX", suffix);
+        }
+
         if let Some(ref python) = builder.config.python {
             cfg.define("PYTHON_EXECUTABLE", python);
         }