Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rustbuild: allow configuring llvm version suffix #53987

Merged
merged 1 commit into from
Sep 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions config.toml.example
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@
# 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'
Expand Down
3 changes: 3 additions & 0 deletions src/bootstrap/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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>
}

Expand Down Expand Up @@ -516,6 +518,7 @@ impl 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();
}

Expand Down
4 changes: 4 additions & 0 deletions src/bootstrap/native.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,10 @@ impl Step for Llvm {
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);
}
Expand Down