@@ -113,6 +113,7 @@ pub struct Target {
113
113
#[ derive( RustcDecodable , Default ) ]
114
114
struct TomlConfig {
115
115
build : Option < Build > ,
116
+ install : Option < Install > ,
116
117
llvm : Option < Llvm > ,
117
118
rust : Option < Rust > ,
118
119
target : Option < HashMap < String , TomlTarget > > ,
@@ -126,7 +127,6 @@ struct Build {
126
127
target : Vec < String > ,
127
128
cargo : Option < String > ,
128
129
rustc : Option < String > ,
129
- prefix : Option < String > ,
130
130
compiler_docs : Option < bool > ,
131
131
docs : Option < bool > ,
132
132
submodules : Option < bool > ,
@@ -136,6 +136,12 @@ struct Build {
136
136
python : Option < String > ,
137
137
}
138
138
139
+ /// TOML representation of various global install decisions.
140
+ #[ derive( RustcDecodable , Default , Clone ) ]
141
+ struct Install {
142
+ prefix : Option < String > ,
143
+ }
144
+
139
145
/// TOML representation of how the LLVM build is configured.
140
146
#[ derive( RustcDecodable , Default ) ]
141
147
struct Llvm {
@@ -239,7 +245,6 @@ impl Config {
239
245
}
240
246
config. rustc = build. rustc . map ( PathBuf :: from) ;
241
247
config. cargo = build. cargo . map ( PathBuf :: from) ;
242
- config. prefix = build. prefix ;
243
248
config. nodejs = build. nodejs . map ( PathBuf :: from) ;
244
249
config. gdb = build. gdb . map ( PathBuf :: from) ;
245
250
config. python = build. python . map ( PathBuf :: from) ;
@@ -248,6 +253,10 @@ impl Config {
248
253
set ( & mut config. submodules , build. submodules ) ;
249
254
set ( & mut config. vendor , build. vendor ) ;
250
255
256
+ if let Some ( ref install) = toml. install {
257
+ config. prefix = install. prefix . clone ( ) ;
258
+ }
259
+
251
260
if let Some ( ref llvm) = toml. llvm {
252
261
set ( & mut config. ccache , llvm. ccache ) ;
253
262
set ( & mut config. ninja , llvm. ninja ) ;
@@ -257,6 +266,7 @@ impl Config {
257
266
set ( & mut config. llvm_version_check , llvm. version_check ) ;
258
267
set ( & mut config. llvm_static_stdcpp , llvm. static_libstdcpp ) ;
259
268
}
269
+
260
270
if let Some ( ref rust) = toml. rust {
261
271
set ( & mut config. rust_debug_assertions , rust. debug_assertions ) ;
262
272
set ( & mut config. rust_debuginfo , rust. debuginfo ) ;
0 commit comments