| •1 |
use std::env; |
| 2 |
|
| 3 |
fn main() { |
| 4 |
let source_files = vec![ |
| 5 |
"src/cache.rs", |
| 6 |
"src/progress.rs", |
| 7 |
"src/config.rs", |
| 8 |
"src/util.rs", |
| 9 |
"src/records.rs", |
| 10 |
"src/depcache.rs", |
| 11 |
"src/pkgmanager.rs", |
| 12 |
"src/error.rs", |
| 13 |
"src/acquire.rs", |
| 14 |
"src/iterators/package.rs", |
| 15 |
"src/iterators/version.rs", |
| 16 |
"src/iterators/dependency.rs", |
| 17 |
"src/iterators/provider.rs", |
| 18 |
"src/iterators/files.rs", |
| 19 |
]; |
| 20 |
|
| 21 |
let mut cc_files = vec!["apt-pkg-c/error.cc"]; |
| 22 |
|
| 23 |
cxx_build::bridges(&source_files) |
| 24 |
.files(&cc_files) |
| •25 |
.flag_if_supported("-std=c++17") |
| 26 |
.compile("rust-apt"); |
| 27 |
|
| 28 |
println!("cargo:rustc-link-lib=apt-pkg"); |
| 29 |
for file in source_files { |
| 30 |
println!("cargo:rerun-if-changed={file}") |
| 31 |
} |
| 32 |
|
| 33 |
cc_files.extend_from_slice(&[ |
| 34 |
"apt-pkg-c/cache.h", |
| 35 |
"apt-pkg-c/progress.h", |
| 36 |
"apt-pkg-c/configuration.h", |
| 37 |
"apt-pkg-c/util.h", |
| 38 |
"apt-pkg-c/records.h", |
| 39 |
"apt-pkg-c/depcache.h", |
| 40 |
"apt-pkg-c/package.h", |
| 41 |
"apt-pkg-c/pkgmanager.h", |
| 42 |
"apt-pkg-c/error.h", |
| 43 |
"apt-pkg-c/types.h", |
| 44 |
"apt-pkg-c/acquire.h", |
| 45 |
]); |
| 46 |
|
| 47 |
for file in cc_files { |
| 48 |
println!("cargo:rerun-if-changed={file}") |
| 49 |
} |
| •50 |
println!("dh-cargo:deb-built-using=rust-apt=1={}", env::var("CARGO_MANIFEST_DIR").unwrap()); |
| 51 |
} |