-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- v0.54.6
- v0.54.5
- v0.54.4
- v0.54.3
- v0.54.2
- v0.54.1
- v0.54.0
- v0.53.2
- v0.53.1
- v0.53.0
- v0.52.3
- v0.52.2
- v0.52.1
- v0.52.0
- v0.51.1
- v0.51.0
- v0.50.6
- v0.50.5
- v0.50.4
- v0.50.3
- v0.50.2
- v0.50.1
- v0.50.0
- v0.49.0
- v0.49.0-alpha.2
- v0.48.1
- v0.48.0
- v0.48.0-alpha.1
- v0.47.8
- v0.47.7
- v0.47.6
- v0.47.5
- v0.47.4
- v0.47.3
- v0.47.2
- v0.47.1
- v0.47.0
- v0.46.1
- v0.46.0
- v0.45.2
- v0.45.1
- v0.45.0
- v0.44.0
- v0.43.5
1 parent
7aa341e
commit d9cae84
Showing
6 changed files
with
49 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,26 @@ | ||
mod git_describe; | ||
pub mod post_build; | ||
pub mod twiggy; | ||
mod wasm_imports; | ||
mod wasm_opt; | ||
mod wasm_to_wat; | ||
|
||
pub use git_describe::git_describe; | ||
pub use wasm_imports::extract_wasm_imports; | ||
pub use wasm_opt::run_wasm_opt; | ||
pub use wasm_to_wat::wasm_to_wat; | ||
|
||
use crate::cli_args::BuildArgs; | ||
|
||
pub fn check_tools_installed(build_args: &mut BuildArgs) { | ||
if build_args.wasm_opt && !wasm_opt::is_wasm_opt_installed() { | ||
println!("Warning: {} not installed", wasm_opt::WASM_OPT_NAME); | ||
build_args.wasm_opt = false; | ||
} | ||
if build_args.has_twiggy_call() && !twiggy::is_twiggy_installed() { | ||
println!("Warning: {} not installed", twiggy::TWIGGY_NAME); | ||
build_args.twiggy_top = false; | ||
build_args.twiggy_paths = false; | ||
build_args.twiggy_monos = false; | ||
build_args.twiggy_dominators = false; | ||
} | ||
} |
39 changes: 2 additions & 37 deletions
39
framework/meta/src/tools/post_build.rs → framework/meta/src/tools/twiggy.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
use std::process::Command; | ||
|
||
pub const WASM_OPT_NAME: &str = "wasm-opt"; | ||
|
||
pub fn is_wasm_opt_installed() -> bool { | ||
Command::new(WASM_OPT_NAME) | ||
.args(["--version"]) | ||
.output() | ||
.is_ok() | ||
} | ||
|
||
pub fn run_wasm_opt(output_wasm_path: &str) { | ||
let exit_status = Command::new(WASM_OPT_NAME) | ||
.args([output_wasm_path, "-Oz", "--output", output_wasm_path]) | ||
.spawn() | ||
.expect("failed to spawn wasm-opt process") | ||
.wait() | ||
.expect("wasm-opt was not running"); | ||
|
||
assert!(exit_status.success(), "wasm-opt process failed"); | ||
} |