2 releases

Uses old Rust 2015

0.1.1 Apr 1, 2017
0.1.0 Mar 23, 2017

#7 in #lcm

Custom license

4KB
55 lines

Generate LCM messages at build time

This crate lets you invoke lcm-gen as part of a Cargo build script. It requires that you have lcm-gen on your PATH, and that it supports emitting Rust code with the --rust and --rust-path options.


lib.rs:

Crate docs

Example:

// build.rs
use std::env;
use std::path::PathBuf;

fn main() {
    // lcm types are in a sibling directory: ../types/
    let mut lcm_source_dir : PathBuf = env!("CARGO_MANIFEST_DIR").into();
    lcm_source_dir.pop();
    lcm_source_dir.push("types");

    println!("cargo:rerun-if-changed={}", lcm_source_dir.display());

    lcm_gen::LcmGen::new()
        .add_directory(lcm_source_dir)
        .run();
}

Dependencies

~53KB