Skip to content

Commit

Permalink
Link pineappl_applgrid against LHAPDF
Browse files Browse the repository at this point in the history
  • Loading branch information
cschwan committed Nov 8, 2023
1 parent 4d74a05 commit f4735a7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions pineappl_applgrid/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ cxx = "1.0.65"
[build-dependencies]
cc = "1.0.49"
cxx-build = "1.0.65"
pkg-config = "0.3.26"
14 changes: 14 additions & 0 deletions pineappl_applgrid/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,24 @@ fn main() {

println!("cargo:rerun-if-env-changed=APPL_IGRID_DIR");

let lhapdf = pkg_config::Config::new()
.atleast_version("6")
.probe("lhapdf")
.unwrap();

for lib_path in lhapdf.link_paths {
println!("cargo:rustc-link-search={}", lib_path.to_str().unwrap());
}

for lib in lhapdf.libs {
println!("cargo:rustc-link-lib={}", lib);
}

cxx_build::bridge("src/lib.rs")
.file("src/applgrid.cpp")
.include(include_path.trim())
.include(appl_igrid_dir)
.includes(lhapdf.include_paths)
.compile("appl-bridge");

println!("cargo:rerun-if-changed=src/lib.rs");
Expand Down

0 comments on commit f4735a7

Please sign in to comment.