Fix warnings when the "wasm" feature is disabled.
This commit is contained in:
@@ -24,6 +24,7 @@ extern crate cfg_if;
|
||||
extern crate capstone;
|
||||
extern crate clap;
|
||||
extern crate cranelift_codegen;
|
||||
#[cfg(feature = "wasm")]
|
||||
extern crate cranelift_entity;
|
||||
extern crate cranelift_filetests;
|
||||
extern crate cranelift_reader;
|
||||
@@ -245,13 +246,14 @@ fn main() {
|
||||
("wasm", Some(rest_cmd)) => {
|
||||
handle_debug_flag(rest_cmd.is_present("debug"));
|
||||
|
||||
#[cfg(feature = "wasm")]
|
||||
let result = {
|
||||
let mut target_val: &str = "";
|
||||
if let Some(clap_target) = rest_cmd.value_of("target") {
|
||||
target_val = clap_target;
|
||||
}
|
||||
|
||||
#[cfg(feature = "wasm")]
|
||||
let result = wasm::run(
|
||||
wasm::run(
|
||||
get_vec(rest_cmd.values_of("file")),
|
||||
rest_cmd.is_present("verbose"),
|
||||
rest_cmd.is_present("just-decode"),
|
||||
@@ -261,7 +263,8 @@ fn main() {
|
||||
target_val,
|
||||
rest_cmd.is_present("print-size"),
|
||||
rest_cmd.is_present("time-passes"),
|
||||
);
|
||||
)
|
||||
};
|
||||
|
||||
#[cfg(not(feature = "wasm"))]
|
||||
let result = Err("Error: clif-util was compiled without wasm support.".to_owned());
|
||||
|
||||
@@ -25,6 +25,7 @@ pub fn read_to_string<P: AsRef<Path>>(path: P) -> io::Result<String> {
|
||||
}
|
||||
|
||||
/// Read an entire file into a vector of bytes.
|
||||
#[cfg(feature = "wasm")]
|
||||
pub fn read_to_end<P: AsRef<Path>>(path: P) -> io::Result<Vec<u8>> {
|
||||
let mut buffer = Vec::new();
|
||||
if path.as_ref() == Path::new("-") {
|
||||
|
||||
Reference in New Issue
Block a user