fix: use git's submodule instead of manual clone

This commit is contained in:
Edoardo Marangoni
2024-03-18 14:12:25 +01:00
parent d1bdecd12b
commit 98e91bf8ea
4 changed files with 5 additions and 29 deletions

3
.gitmodules vendored Normal file
View 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

View File

@ -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)

Submodule wasm-micro-runtime deleted from 12f834aebd