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 = []
37
37
lapacke = []
38
38
static = []
39
39
system = []
40
+ shared-build-cache = []
40
41
41
42
[dev-dependencies ]
42
43
libc = " 0.2"
Original file line number Diff line number Diff line change @@ -8,8 +8,13 @@ The following Cargo features are supported:
8
8
9
9
* ` cblas ` to build CBLAS (enabled by default),
10
10
* ` 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.)
13
18
14
19
## Cross Compilation
15
20
Original file line number Diff line number Diff line change @@ -32,7 +32,11 @@ fn main() {
32
32
_ => variable ! ( "TARGET" ) ,
33
33
} ;
34
34
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
+ } ;
36
40
if !source. exists ( ) {
37
41
let source_tmp = PathBuf :: from ( format ! ( "{}_tmp" , source. display( ) ) ) ;
38
42
if source_tmp. exists ( ) {
You can’t perform that action at this time.
0 commit comments