Skip to content

Commit

Permalink
examples: Run the correct example executable on Windows
Browse files Browse the repository at this point in the history
We were accidentally always running the `fib-debug/main` example because of
shenanigans with alphabetical ordering and hard coding "main.exe" as the command
we run. Now we properly detect which example we built and run the appropriate
executable.
  • Loading branch information
fitzgen committed Jul 13, 2020
1 parent 9f0ec62 commit 3638dba
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions crates/misc/run-examples/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,14 @@ fn main() -> anyhow::Result<()> {
.arg("ntdll.lib")
.arg("shell32.lib")
.arg("ole32.lib");
"./main.exe"
if is_dir {
"main.exe".to_string()
} else {
format!("./{}.exe", example)
}
} else {
cmd.arg("target/debug/libwasmtime.a").arg("-o").arg("foo");
"./foo"
"./foo".to_string()
};
if cfg!(target_os = "linux") {
cmd.arg("-lpthread").arg("-ldl").arg("-lm");
Expand Down

0 comments on commit 3638dba

Please sign in to comment.