File tree Expand file tree Collapse file tree 3 files changed +13
-3
lines changed
Expand file tree Collapse file tree 3 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ cblas = []
3737lapacke = []
3838static = []
3939system = []
40+ shared-build-cache = []
4041
4142[dev-dependencies ]
4243libc = " 0.2"
Original file line number Diff line number Diff line change @@ -8,8 +8,13 @@ The following Cargo features are supported:
88
99* ` cblas ` to build CBLAS (enabled by default),
1010* ` lapacke ` to build LAPACKE (enabled by default),
11- * ` static ` to link to OpenBLAS statically, and
12- * ` system ` to skip building the bundled OpenBLAS.
11+ * ` static ` to link to OpenBLAS statically,
12+ * ` system ` to skip building the bundled OpenBLAS, and
13+ * ` shared-build-cache ` to place most of the OpenBLAS build products in
14+ ` ~/.cargo ` instead of the ` target ` directory. (This allows them to be reused
15+ between crates which have different ` target ` directories, in order to avoid
16+ rebuilding OpenBLAS unnecessarily. However, it prevents ` cargo clean ` from
17+ removing the OpenBLAS build products.)
1318
1419## Cross Compilation
1520
Original file line number Diff line number Diff line change @@ -32,7 +32,11 @@ fn main() {
3232 _ => variable ! ( "TARGET" ) ,
3333 } ;
3434 env:: remove_var ( "TARGET" ) ;
35- let source = PathBuf :: from ( format ! ( "source_{}" , target. to_lowercase( ) ) ) ;
35+ let source = if feature ! ( "SHARED_BUILD_CACHE" ) {
36+ PathBuf :: from ( format ! ( "source_{}" , target. to_lowercase( ) ) )
37+ } else {
38+ output. join ( format ! ( "source_{}" , target. to_lowercase( ) ) )
39+ } ;
3640 if !source. exists ( ) {
3741 let source_tmp = PathBuf :: from ( format ! ( "{}_tmp" , source. display( ) ) ) ;
3842 if source_tmp. exists ( ) {
You can’t perform that action at this time.
0 commit comments