代码拉取完成,页面将自动刷新
// mrusty. mruby safe bindings for Rust
// Copyright (C) 2016 Dragoș Tiselice
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
extern crate gcc;
extern crate tar;
extern crate walkdir;
use std::fs::File;
use tar::Archive;
use walkdir::{DirEntry, WalkDir, WalkDirIterator};
fn is_c(entry: &DirEntry) -> bool {
match entry.path().extension() {
Some(ext) => "c" == ext,
None => false
}
}
fn main() {
let mut archive = Archive::new(File::open("src/mruby/mruby-out.tar").unwrap());
archive.unpack("target").unwrap();
let mut config = gcc::Config::new();
for entry in WalkDir::new("target/mruby-out/src").into_iter().filter_entry(|e| e.file_type().is_dir() || is_c(e)) {
let entry = entry.unwrap();
if is_c(&entry) { config.file(entry.path()); }
}
config.include("target/mruby-out/include").compile("libmruby.a");
let mut config = gcc::Config::new();
config.file("src/mrb_ext.c").include("target/mruby-out/include").compile("libmrbe.a");
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。