File tree 2 files changed +438
-227
lines changed
2 files changed +438
-227
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,14 @@ impl LlvmBuildStatus {
54
54
LlvmBuildStatus :: ShouldBuild ( _) => true ,
55
55
}
56
56
}
57
+
58
+ #[ cfg( test) ]
59
+ pub fn llvm_result ( & self ) -> & LlvmResult {
60
+ match self {
61
+ LlvmBuildStatus :: AlreadyBuilt ( res) => res,
62
+ LlvmBuildStatus :: ShouldBuild ( meta) => & meta. res ,
63
+ }
64
+ }
57
65
}
58
66
59
67
/// Linker flags to pass to LLVM's CMake invocation.
@@ -120,12 +128,17 @@ pub fn prebuilt_llvm_config(
120
128
let root = "src/llvm-project/llvm" ;
121
129
let out_dir = builder. llvm_out ( target) ;
122
130
123
- let build_llvm_config = if target == builder. config . build {
131
+ let build_llvm_config = if let Some ( build_llvm_config) = builder
132
+ . config
133
+ . target_config
134
+ . get ( & builder. config . build )
135
+ . and_then ( |config| config. llvm_config . clone ( ) )
136
+ {
137
+ build_llvm_config
138
+ } else {
124
139
let mut llvm_config_ret_dir = builder. llvm_out ( builder. config . build ) ;
125
140
llvm_config_ret_dir. push ( "bin" ) ;
126
141
llvm_config_ret_dir. join ( exe ( "llvm-config" , builder. config . build ) )
127
- } else {
128
- builder. ensure ( Llvm { target : builder. config . build } ) . llvm_config
129
142
} ;
130
143
131
144
let llvm_cmake_dir = out_dir. join ( "lib/cmake/llvm" ) ;
You can’t perform that action at this time.
0 commit comments