Skip to content

Commit fe7e01e

Browse files
committed
fix: Resolve libvalhalla system dependencies
1 parent 0dfa512 commit fe7e01e

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

Cargo.lock

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@ cxx = "1.0"
1414
[build-dependencies]
1515
cmake = "0.1"
1616
cxx-build = "1.0"
17-
miniserde = "0.1" # For compile_commands.json parsing
17+
miniserde = "0.1" # For compile_commands.json parsing
18+
pkg-config = "0.3.32"

build.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,14 @@ fn main() {
3232

3333
let valhalla_includes = extract_includes(&dst.join("build/compile_commands.json"), "config.cc");
3434

35-
// Manually link valhalla because `cmake` crate doesn't fetch the mystery about who depends on what from cmake
35+
// Link Valhalla and its requirements via libvalhalla.pc file, generated by cmake
3636
let dst = dst.display().to_string();
3737
println!("cargo:rustc-link-search={dst}/build/src/");
38-
println!("cargo:rustc-link-lib=valhalla");
38+
pkg_config::Config::new()
39+
.arg("--with-path")
40+
.arg(format!("{dst}/build"))
41+
.probe("libvalhalla")
42+
.unwrap();
3943

4044
// bindings
4145
cxx_build::bridge("src/lib.rs")

0 commit comments

Comments
 (0)