3 Star 1 Fork 0

Gitee 极速下载/mrusty

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/anima-engine/mrusty
克隆/下载
build.rs 1.15 KB
一键复制 编辑 原始数据 按行查看 历史
Dragos Tiselice 提交于 2016-04-13 12:04 . Changed from LGPL to MPL.
// 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");
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Rust
1
https://gitee.com/mirrors/mrusty.git
git@gitee.com:mirrors/mrusty.git
mirrors
mrusty
mrusty
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385