Skip to content

Commit 3deaefa

Browse files
authored
Merge pull request #125 from Dirreke/add-pkg-config
Use pkg-config and fix build on doc.rs
2 parents 5e71a68 + c79abe9 commit 3deaefa

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

openblas-src/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ system = []
3636
libc = "0.2"
3737

3838
[build-dependencies]
39+
pkg-config = "0.3.30"
3940
dirs = "5.0.1"
4041
openblas-build = { version = "0.10.9", path = "../openblas-build" }
4142

openblas-src/build.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,24 @@ fn macos_system() {
7676
}
7777

7878
fn main() {
79+
if env::var("DOCS_RS").is_ok() {
80+
return;
81+
}
7982
let link_kind = if feature_enabled("static") {
8083
"static"
8184
} else {
8285
"dylib"
8386
};
8487
if feature_enabled("system") {
88+
// Use pkg-config to find OpenBLAS
89+
if pkg_config::Config::new()
90+
.statik(feature_enabled("static"))
91+
.probe("openblas")
92+
.is_ok()
93+
{
94+
return;
95+
}
96+
8597
if cfg!(target_os = "windows") {
8698
if cfg!(target_env = "gnu") {
8799
windows_gnu_system();

0 commit comments

Comments
 (0)