Skip to content
Snippets Groups Projects
Commit 5b6f54a0 authored by Ryan Hunt's avatar Ryan Hunt
Browse files

Add an option to Builder for preprocessor defines

parent 45bc829b
No related branches found
No related tags found
No related merge requests found
[root]
name = "cbindgen"
version = "0.3.2"
dependencies = [
"clap 2.24.2 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.21 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_json 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)",
"tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
"toml 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "ansi_term"
version = "0.9.0"
......@@ -31,6 +18,19 @@ name = "bitflags"
version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "cbindgen"
version = "0.3.2"
dependencies = [
"clap 2.24.2 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.21 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_json 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)",
"tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
"toml 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "clap"
version = "2.24.2"
......
......@@ -133,6 +133,24 @@ impl Builder {
self
}
#[allow(unused)]
pub fn with_target_os_define(mut self, platform: &str, preprocessor_define: &str) -> Builder {
self.config.defines.insert(
format!("target_os = {}", platform),
preprocessor_define.to_owned(),
);
self
}
#[allow(unused)]
pub fn with_define(mut self, key: &str, value: &str, preprocessor_define: &str) -> Builder {
self.config.defines.insert(
format!("{} = {}", key, value),
preprocessor_define.to_owned(),
);
self
}
#[allow(unused)]
pub fn with_config(mut self, config: Config) -> Builder {
self.config = config;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment