Skip to content

Commit

Permalink
Merge pull request #125 from Dirreke/add-pkg-config
Browse files Browse the repository at this point in the history
Use pkg-config and fix build on doc.rs
  • Loading branch information
Dirreke authored Nov 28, 2024
2 parents 5e71a68 + c79abe9 commit 3deaefa
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions openblas-src/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ system = []
libc = "0.2"

[build-dependencies]
pkg-config = "0.3.30"
dirs = "5.0.1"
openblas-build = { version = "0.10.9", path = "../openblas-build" }

Expand Down
12 changes: 12 additions & 0 deletions openblas-src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,24 @@ fn macos_system() {
}

fn main() {
if env::var("DOCS_RS").is_ok() {
return;
}
let link_kind = if feature_enabled("static") {
"static"
} else {
"dylib"
};
if feature_enabled("system") {
// Use pkg-config to find OpenBLAS
if pkg_config::Config::new()
.statik(feature_enabled("static"))
.probe("openblas")
.is_ok()
{
return;
}

if cfg!(target_os = "windows") {
if cfg!(target_env = "gnu") {
windows_gnu_system();
Expand Down

0 comments on commit 3deaefa

Please sign in to comment.