///
/// Generate a big bulk file for cpp code for now to allow better code opt and easier to build
/// We may need to change this if we run into memory issues on machines trying to compile it
///
Generate a big bulk file for cpp code for now to allow better code opt and easier to build
We may need to change this if we run into memory issues on machines trying to compile it
Generate a big bulk file for cpp code for now to allow better code opt and easier to build We may need to change this if we run into memory issues on machines trying to compile it
pub fn generate_bulk_cpp(filename: &str, api_defs: &[ApiDef]) -> io::Result<()> {
        let mut dest = BufWriter::new(File::create(filename).unwrap());
        writeln!(
            &mut dest,
            "// This file is auto-generated by rute_gen. DO NOT EDIT!\n"
        )?;
        let mut files = Vec::new();
        for sdef in api_defs {
            let base_filename = Path::new(&sdef.filename)
                .file_name()
                .unwrap()
                .to_str()
                .unwrap();
            let base_filename = &base_filename[..base_filename.len() - 4];
            // TODO: Fixme
            if base_filename != "qnamespace" {
                files.push(base_filename.to_owned());
            }
        }
        files.sort();
        for f in &files {
            writeln!(dest, "#include \"{}_ffi.h\"", f)?;
            writeln!(dest, "#include \"{}.h\"", f)?;
        }
        writeln!(dest, "#include \"rute_signal_wrappers.h\"")?;
        writeln!(dest, "#include \"qt_enum_mapping.h\"")?;
        writeln!(dest, "")?;
        for f in &files {
            writeln!(dest, "#include \"{}.cpp\"", f)?;
        }
        // include main file as last file
        writeln!(dest, "#include \"qt_enum_mapping.cpp\"")?;
        writeln!(dest, "#include \"qt_rute.cpp\"")
    }
pub fn generate_bulk_cpp ( filename : & str , api_defs : & [ ApiDef ] ) -> io :: Result < ( ) > { let mut dest = BufWriter :: new ( File :: create ( filename ) . unwrap ( ) ) ; writeln ! ( mut dest " \n " ) ? ; let mut files = Vec :: new ( ) ; for sdef in api_defs { let base_filename = Path :: new ( & sdef . filename ) . file_name ( ) . unwrap ( ) . to_str ( ) . unwrap ( ) ; let base_filename = & base_filename [ .. base_filename . len ( ) - 4 ] ; // TODO: Fixme if base_filename != " " { files . push ( base_filename . to_owned ( ) ) ; } } files . sort ( ) ; for f in & files { writeln ! ( dest " \" \" " f ) ? ; writeln ! ( dest " \" \" " f ) ? ; } writeln ! ( dest " \" \" " ) ? ; writeln ! ( dest " \" \" " ) ? ; writeln ! ( dest " " ) ? ; for f in & files { writeln ! ( dest " \" \" " f ) ? ; } // include main file as last file writeln ! ( dest " \" \" " ) ? ; writeln ! ( dest " \" \" " ) }
Generate a big bulk file for cpp code for now to allow better code opt and easier to build
We may need to change this if we run into memory issues on machines trying to compile it
Generate a big bulk file for cpp code for now to allow better code opt and easier to build We may need to change this if we run into memory issues on machines trying to compile it
filename
&str
api_defs
&[ApiDef]