Skip to content

Commit 03887a1

Browse files
authored
Merge pull request #8 from shigedangao/fix/documentation
Fix documentation generation due to missing headers
2 parents 9315d25 + 1511a31 commit 03887a1

5 files changed

Lines changed: 23 additions & 7 deletions

File tree

.cargo/config.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ rustflags = ["-C", "link-arg=-Wl,-rpath,@executable_path/../lib"]
33

44
[env]
55
INSIGHTFACE_PATH = "/Users/marcintha/workspace/baklava/insightface/cpp-package/inspireface/build/inspireface-macos/InspireFace"
6+
# Enable the setting below to generate documentation locally
7+
# DOCS_RS = "true"

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "baklava"
33
description = "A rust wrapper around the InsightFace library to perform face comparison"
4-
version = "0.1.0"
4+
version = "0.1.1"
55
edition = "2021"
66
authors = ["Marc Intha-amnouay <marc.inthaamnouay@gmail.com>"]
77
keywords = ["insightface", "face-comparison", "inspireface"]

build.rs

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,31 @@
11
use std::env;
22
use std::path::PathBuf;
3+
use std::process::Command;
34

45
fn main() {
56
let lib_path = match env::var("INSIGHTFACE_PATH") {
67
Ok(path) => PathBuf::from(path),
78
Err(_) => {
89
let current_dir = env::current_dir().unwrap();
9-
let local_path = format!(
10-
"insightface/cpp-package/inspireface/build/inspireface-{}/InspireFace",
11-
env::consts::OS
12-
);
10+
match env::var("DOCS_RS").is_ok() {
11+
true => {
12+
// The headers can be passed from the "zipped" file "insightface_headers.zip"
13+
Command::new("unzip")
14+
.arg("insightface_headers.zip")
15+
.spawn()
16+
.expect("Expect unzip command to work");
1317

14-
current_dir.join(local_path)
18+
current_dir
19+
}
20+
false => {
21+
let local_path = format!(
22+
"insightface/cpp-package/inspireface/build/inspireface-{}/InspireFace",
23+
env::consts::OS
24+
);
25+
26+
current_dir.join(local_path)
27+
}
28+
}
1529
}
1630
};
1731

insightface_headers.zip

54.7 KB
Binary file not shown.

0 commit comments

Comments
 (0)