diff options
Diffstat (limited to 'build.rs')
-rw-r--r-- | build.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/build.rs b/build.rs new file mode 100644 index 0000000..10c0d21 --- /dev/null +++ b/build.rs @@ -0,0 +1,21 @@ +extern crate gcc; + +use std::env; + +fn main() { + let target = env::var("TARGET").unwrap(); + println!("cargo:rustc-link-lib=strophe"); + + let mut config = gcc::Config::new(); + config.file("clib/sendxmpp.c"); + if target.contains("freebsd") { + println!("cargo:rustc-link-search=native=/usr/local/lib"); + config.include("/usr/local/include"); + } else if target.contains("linux") { + // ok pass + } else { + println!("Unknown OS, need to adapt build.rs"); + std::process::exit(1); + } + config.compile("libsendxmpp.a"); +} |