mirror of
https://github.com/librespot-org/librespot.git
synced 2024-11-08 16:45:43 +00:00
27 lines
761 B
Rust
27 lines
761 B
Rust
extern crate vergen;
|
|
#[cfg(feature = "with-syntex")] extern crate syntex;
|
|
#[cfg(feature = "with-syntex")] extern crate json_macros;
|
|
#[cfg(feature = "with-syntex")] extern crate protobuf_macros;
|
|
|
|
#[cfg(feature = "with-syntex")]
|
|
fn codegen() {
|
|
use std::env;
|
|
use std::path::PathBuf;
|
|
use std::path::Path;
|
|
|
|
let mut registry = syntex::Registry::new();
|
|
let out = PathBuf::from(env::var("OUT_DIR").unwrap());
|
|
|
|
json_macros::plugin_registrar(&mut registry);
|
|
protobuf_macros::plugin_registrar(&mut registry);
|
|
registry.expand("librespot", Path::new("src/lib.in.rs"), &out.join("lib.rs")).unwrap();
|
|
}
|
|
|
|
#[cfg(not(feature = "with-syntex"))]
|
|
fn codegen() { }
|
|
|
|
fn main() {
|
|
vergen::vergen(vergen::OutputFns::all()).unwrap();
|
|
codegen();
|
|
}
|
|
|