Commit 549e4622 authored by Ryan Hunt's avatar Ryan Hunt

Move most src into bindgen, and add lib target

parent 0571ae14
......@@ -14,3 +14,11 @@ log = "0.3"
[dependencies.syn]
version = "0.11"
features = ["full"]
[[bin]]
name = "cbindgen"
path = "src/main.rs"
[lib]
name = "cbindgen"
path = "src/lib.rs"
......@@ -2,7 +2,7 @@ use std::io::Write;
use syn::*;
use config::Config;
use bindgen::config::Config;
use bindgen::directive::*;
use bindgen::library::*;
use bindgen::syn_helpers::*;
......
......@@ -4,11 +4,11 @@ use std::cmp::Ordering;
use syn::*;
use config;
use config::Config;
use rust_lib;
use bindgen::config;
use bindgen::config::Config;
use bindgen::directive::*;
use bindgen::items::*;
use bindgen::rust_lib;
use bindgen::syn_helpers::*;
pub type ConvertResult<T> = Result<T, String>;
......
mod config;
mod directive;
mod items;
mod library;
mod rust_lib;
mod syn_helpers;
pub use self::config::*;
pub use self::library::{Library, BuiltLibrary};
#[macro_use]
extern crate log;
extern crate syn;
mod bindgen;
pub use bindgen::*;
......@@ -9,15 +9,13 @@ extern crate clap;
use clap::{Arg, App};
mod logging;
mod config;
mod rust_lib;
mod bindgen;
use config::Config;
use bindgen::Config;
fn main() {
let matches = App::new("cbindgen")
.version(config::VERSION)
.version(bindgen::VERSION)
.about("Generate C bindings for a Rust library")
.arg(Arg::with_name("config")
.short("c")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment