mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-07 13:18:20 +00:00
Add root_dir to include paths
This commit is contained in:
@@ -105,9 +105,7 @@ impl Config {
|
|||||||
println!("manifest dir = {manifest_dir}, wasmer root dir = {wasmer_base_dir}");
|
println!("manifest dir = {manifest_dir}, wasmer root dir = {wasmer_base_dir}");
|
||||||
config.wasmer_dir = wasmer_base_dir.clone() + "/package";
|
config.wasmer_dir = wasmer_base_dir.clone() + "/package";
|
||||||
if !std::path::Path::new(&config.wasmer_dir).exists() {
|
if !std::path::Path::new(&config.wasmer_dir).exists() {
|
||||||
if !std::path::Path::new(&format!("{wasmer_base_dir}/target/release"))
|
if !std::path::Path::new(&format!("{wasmer_base_dir}/target/release")).exists() {
|
||||||
.exists()
|
|
||||||
{
|
|
||||||
println!("running make build-capi...");
|
println!("running make build-capi...");
|
||||||
// run make build-capi
|
// run make build-capi
|
||||||
let mut cmd = std::process::Command::new("make");
|
let mut cmd = std::process::Command::new("make");
|
||||||
@@ -160,13 +158,15 @@ fn find_wasmer_base_dir() -> String {
|
|||||||
.split("wasmer/lib/c-api")
|
.split("wasmer/lib/c-api")
|
||||||
.next()
|
.next()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.to_string() + "wasmer";
|
.to_string()
|
||||||
|
+ "wasmer";
|
||||||
} else if wasmer_base_dir.contains("wasmer\\lib\\c-api") {
|
} else if wasmer_base_dir.contains("wasmer\\lib\\c-api") {
|
||||||
wasmer_base_dir = wasmer_base_dir
|
wasmer_base_dir = wasmer_base_dir
|
||||||
.split("wasmer\\lib\\c-api")
|
.split("wasmer\\lib\\c-api")
|
||||||
.next()
|
.next()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.to_string() + "wasmer";
|
.to_string()
|
||||||
|
+ "wasmer";
|
||||||
}
|
}
|
||||||
|
|
||||||
wasmer_base_dir
|
wasmer_base_dir
|
||||||
@@ -307,6 +307,8 @@ fn test_run() {
|
|||||||
} else if !config.wasmer_dir.is_empty() {
|
} else if !config.wasmer_dir.is_empty() {
|
||||||
command.arg("-I");
|
command.arg("-I");
|
||||||
command.arg(&format!("{}/include", config.wasmer_dir));
|
command.arg(&format!("{}/include", config.wasmer_dir));
|
||||||
|
command.arg("-I");
|
||||||
|
command.arg(&config.root_dir);
|
||||||
}
|
}
|
||||||
if !config.ldflags.is_empty() {
|
if !config.ldflags.is_empty() {
|
||||||
for f in config.ldflags.split_whitespace() {
|
for f in config.ldflags.split_whitespace() {
|
||||||
|
|||||||
@@ -40,9 +40,7 @@ impl Config {
|
|||||||
println!("manifest dir = {manifest_dir}, wasmer root dir = {wasmer_base_dir}");
|
println!("manifest dir = {manifest_dir}, wasmer root dir = {wasmer_base_dir}");
|
||||||
config.wasmer_dir = wasmer_base_dir.clone() + "/package";
|
config.wasmer_dir = wasmer_base_dir.clone() + "/package";
|
||||||
if !std::path::Path::new(&config.wasmer_dir).exists() {
|
if !std::path::Path::new(&config.wasmer_dir).exists() {
|
||||||
if !std::path::Path::new(&format!("{wasmer_base_dir}/target/release"))
|
if !std::path::Path::new(&format!("{wasmer_base_dir}/target/release")).exists() {
|
||||||
.exists()
|
|
||||||
{
|
|
||||||
println!("running make build-capi...");
|
println!("running make build-capi...");
|
||||||
// run make build-capi
|
// run make build-capi
|
||||||
let mut cmd = std::process::Command::new("make");
|
let mut cmd = std::process::Command::new("make");
|
||||||
@@ -109,13 +107,15 @@ fn find_wasmer_base_dir() -> String {
|
|||||||
.split("wasmer/lib/c-api")
|
.split("wasmer/lib/c-api")
|
||||||
.next()
|
.next()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.to_string() + "wasmer";
|
.to_string()
|
||||||
|
+ "wasmer";
|
||||||
} else if wasmer_base_dir.contains("wasmer\\lib\\c-api") {
|
} else if wasmer_base_dir.contains("wasmer\\lib\\c-api") {
|
||||||
wasmer_base_dir = wasmer_base_dir
|
wasmer_base_dir = wasmer_base_dir
|
||||||
.split("wasmer\\lib\\c-api")
|
.split("wasmer\\lib\\c-api")
|
||||||
.next()
|
.next()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.to_string() + "wasmer";
|
.to_string()
|
||||||
|
+ "wasmer";
|
||||||
}
|
}
|
||||||
|
|
||||||
wasmer_base_dir
|
wasmer_base_dir
|
||||||
@@ -331,6 +331,8 @@ fn test_ok() {
|
|||||||
} else if !config.wasmer_dir.is_empty() {
|
} else if !config.wasmer_dir.is_empty() {
|
||||||
command.arg("-I");
|
command.arg("-I");
|
||||||
command.arg(&format!("{}/include", config.wasmer_dir));
|
command.arg(&format!("{}/include", config.wasmer_dir));
|
||||||
|
command.arg("-I");
|
||||||
|
command.arg(&config.root_dir);
|
||||||
}
|
}
|
||||||
if !config.ldflags.is_empty() {
|
if !config.ldflags.is_empty() {
|
||||||
for f in config.ldflags.split_whitespace() {
|
for f in config.ldflags.split_whitespace() {
|
||||||
|
|||||||
Reference in New Issue
Block a user