Build support for no llvm
This commit is contained in:
parent
73c3f55a3e
commit
e152a1620b
4 changed files with 17 additions and 0 deletions
|
@ -53,6 +53,7 @@ pub struct Config {
|
||||||
pub profiler: bool,
|
pub profiler: bool,
|
||||||
|
|
||||||
// llvm codegen options
|
// llvm codegen options
|
||||||
|
pub llvm_enabled: bool,
|
||||||
pub llvm_assertions: bool,
|
pub llvm_assertions: bool,
|
||||||
pub llvm_optimize: bool,
|
pub llvm_optimize: bool,
|
||||||
pub llvm_release_debuginfo: bool,
|
pub llvm_release_debuginfo: bool,
|
||||||
|
@ -192,6 +193,7 @@ struct Install {
|
||||||
#[derive(Deserialize, Default)]
|
#[derive(Deserialize, Default)]
|
||||||
#[serde(deny_unknown_fields, rename_all = "kebab-case")]
|
#[serde(deny_unknown_fields, rename_all = "kebab-case")]
|
||||||
struct Llvm {
|
struct Llvm {
|
||||||
|
enabled: Option<bool>,
|
||||||
ccache: Option<StringOrBool>,
|
ccache: Option<StringOrBool>,
|
||||||
ninja: Option<bool>,
|
ninja: Option<bool>,
|
||||||
assertions: Option<bool>,
|
assertions: Option<bool>,
|
||||||
|
@ -265,6 +267,7 @@ struct TomlTarget {
|
||||||
impl Config {
|
impl Config {
|
||||||
pub fn parse(build: &str, file: Option<PathBuf>) -> Config {
|
pub fn parse(build: &str, file: Option<PathBuf>) -> Config {
|
||||||
let mut config = Config::default();
|
let mut config = Config::default();
|
||||||
|
config.llvm_enabled = true;
|
||||||
config.llvm_optimize = true;
|
config.llvm_optimize = true;
|
||||||
config.use_jemalloc = true;
|
config.use_jemalloc = true;
|
||||||
config.backtrace = true;
|
config.backtrace = true;
|
||||||
|
@ -345,6 +348,7 @@ impl Config {
|
||||||
Some(StringOrBool::Bool(false)) | None => {}
|
Some(StringOrBool::Bool(false)) | None => {}
|
||||||
}
|
}
|
||||||
set(&mut config.ninja, llvm.ninja);
|
set(&mut config.ninja, llvm.ninja);
|
||||||
|
set(&mut config.llvm_enabled, llvm.enabled);
|
||||||
set(&mut config.llvm_assertions, llvm.assertions);
|
set(&mut config.llvm_assertions, llvm.assertions);
|
||||||
set(&mut config.llvm_optimize, llvm.optimize);
|
set(&mut config.llvm_optimize, llvm.optimize);
|
||||||
set(&mut config.llvm_release_debuginfo, llvm.release_debuginfo);
|
set(&mut config.llvm_release_debuginfo, llvm.release_debuginfo);
|
||||||
|
|
|
@ -14,6 +14,10 @@
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
[llvm]
|
[llvm]
|
||||||
|
|
||||||
|
# Indicates whether rustc will support compilation with LLVM
|
||||||
|
# note: rustc does not compile without LLVM at the moment
|
||||||
|
#enabled = true
|
||||||
|
|
||||||
# Indicates whether the LLVM build is a Release or Debug build
|
# Indicates whether the LLVM build is a Release or Debug build
|
||||||
#optimize = true
|
#optimize = true
|
||||||
|
|
||||||
|
|
|
@ -429,6 +429,9 @@ impl Build {
|
||||||
if self.config.use_jemalloc {
|
if self.config.use_jemalloc {
|
||||||
features.push_str(" jemalloc");
|
features.push_str(" jemalloc");
|
||||||
}
|
}
|
||||||
|
if self.config.llvm_enabled {
|
||||||
|
features.push_str(" llvm");
|
||||||
|
}
|
||||||
features
|
features
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -56,6 +56,12 @@ impl Step for Llvm {
|
||||||
fn run(self, builder: &Builder) {
|
fn run(self, builder: &Builder) {
|
||||||
let build = builder.build;
|
let build = builder.build;
|
||||||
let target = self.target;
|
let target = self.target;
|
||||||
|
|
||||||
|
// If we're not compiling for LLVM bail out here.
|
||||||
|
if !build.config.llvm_enabled {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// If we're using a custom LLVM bail out here, but we can only use a
|
// If we're using a custom LLVM bail out here, but we can only use a
|
||||||
// custom LLVM for the build triple.
|
// custom LLVM for the build triple.
|
||||||
if let Some(config) = build.config.target_config.get(&target) {
|
if let Some(config) = build.config.target_config.get(&target) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue