Crates.io | cc-args |
lib.rs | cc-args |
version | 0.2.0 |
source | src |
created_at | 2022-06-11 22:41:05.345424 |
updated_at | 2024-01-20 18:57:42.015435 |
description | The clue between pkg-config and bindgen, cc |
homepage | https://github.com/shurizzle/cc-args |
repository | https://github.com/shurizzle/cc-args |
max_upload_size | |
id | 604245 |
size | 15,860 |
bindgen::Builder::merge_cc_args(&self, &pkg_config::Library)
This crate exports CcArgs
and MergeCcArgs
.
It provides link_paths, include_paths, framework_paths, frameworks, libs, ld_args and defines.
It provides the method merge_cc_args
that accept a CcArgs
implementation.
CcArgs
for pkg_config::Library
MergeCcArgs
for cc::Build
MergeCcArgs
for bindgen::Builder
build.rs
use std::path::PathBuf;
use cc_args::{bindgen, pkg_config, MergeCcArgs};
fn main() {
let out_path = PathBuf::from(std::env::var("OUT_DIR").unwrap());
println!("cargo:rerun-if-changed=wrapper.h");
bindgen::Builder::default()
.merge_cc_args(&pkg_config::probe_library("libzstd").unwrap())
.header("wrapper.h")
.parse_callbacks(Box::new(bindgen::CargoCallbacks))
.generate()
.unwrap()
.write_to_file(out_path.join("bindings.rs"))
.unwrap();
}