diff options
author | Yves Fischer <yvesf-git@xapek.org> | 2016-09-04 00:05:26 +0200 |
---|---|---|
committer | Yves Fischer <yvesf-git@xapek.org> | 2016-09-14 21:15:14 +0200 |
commit | 9416cd3d62f15f5d59f3bff94299f690e69a230d (patch) | |
tree | 4972cacce2dcbaa58d4a434f3ea7bce0616e11bc /rust/build.rs | |
parent | 53b5c00e625bf700a21be1a3e2070d3b23f1bef4 (diff) | |
download | auth-xmppmessage-9416cd3d62f15f5d59f3bff94299f690e69a230d.tar.gz auth-xmppmessage-9416cd3d62f15f5d59f3bff94299f690e69a230d.zip |
switch to using tiny_http
civet fails on FreeBSD because the mongoose Makefile requires gmake.
Diffstat (limited to 'rust/build.rs')
-rw-r--r-- | rust/build.rs | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/rust/build.rs b/rust/build.rs index 3e9c14f..10c0d21 100644 --- a/rust/build.rs +++ b/rust/build.rs @@ -1,6 +1,21 @@ extern crate gcc; +use std::env; + fn main() { - gcc::compile_library("libsendxmpp.a", &["clib/sendxmpp.c"]); - println!("cargo:rustc-link-lib=strophe") -}
\ No newline at end of file + 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"); +} |