mirror of
https://github.com/mii443/wasmer.git
synced 2025-08-22 16:35:33 +00:00
fix: use git's submodule instead of manual clone
This commit is contained in:
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
[submodule "lib/api/third_party/wamr/wasm-micro-runtime"]
|
||||
path = lib/api/third_party/wamr/wasm-micro-runtime
|
||||
url = https://github.com/bytecodealliance/wasm-micro-runtime.git
|
@ -1,35 +1,9 @@
|
||||
use cmake::Config;
|
||||
use std::{
|
||||
env,
|
||||
path::PathBuf,
|
||||
process::Command,
|
||||
};
|
||||
|
||||
fn maybe_clone_repo(dest: PathBuf, repo: &str) {
|
||||
if !dest.exists() {
|
||||
assert!(Command::new("git")
|
||||
.arg("clone")
|
||||
.arg("--depth=1")
|
||||
.arg(repo)
|
||||
.arg(dest)
|
||||
.status()
|
||||
.unwrap()
|
||||
.success());
|
||||
}
|
||||
}
|
||||
use std::{env, path::PathBuf};
|
||||
|
||||
fn main() {
|
||||
let crate_root = env::var("CARGO_MANIFEST_DIR").unwrap();
|
||||
let wamr_dir = PathBuf::from(crate_root).join("third_party").join("wamr");
|
||||
let dist = wamr_dir.join("wasm-micro-runtime");
|
||||
|
||||
maybe_clone_repo(
|
||||
dist,
|
||||
"https://github.com/bytecodealliance/wasm-micro-runtime.git",
|
||||
);
|
||||
// if dist_githead.exists() {
|
||||
// println!("cargo:rerun-if-changed={}", dist_githead.display());
|
||||
// }
|
||||
|
||||
let dst = Config::new(wamr_dir)
|
||||
.always_configure(true)
|
||||
|
2
lib/api/third_party/wamr/wasm-micro-runtime
vendored
2
lib/api/third_party/wamr/wasm-micro-runtime
vendored
Submodule lib/api/third_party/wamr/wasm-micro-runtime updated: 12f834aebd...b11a1d157d
Submodule wasm-micro-runtime deleted from 12f834aebd
Reference in New Issue
Block a user