mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-09 06:08:29 +00:00
Remove duplicated code paths for create-exe
This commit is contained in:
@@ -190,56 +190,46 @@ impl CreateExe {
|
|||||||
};
|
};
|
||||||
std::fs::create_dir_all(&tempdir)?;
|
std::fs::create_dir_all(&tempdir)?;
|
||||||
|
|
||||||
if let Ok(pirita) = WebCMmap::parse(input_path.clone(), &ParseOptions::default()) {
|
let atoms =
|
||||||
// pirita file
|
if let Ok(pirita) = WebCMmap::parse(input_path.clone(), &ParseOptions::default()) {
|
||||||
let atoms = compile_pirita_into_directory(
|
// pirita file
|
||||||
&pirita,
|
compile_pirita_into_directory(
|
||||||
&tempdir,
|
&pirita,
|
||||||
&self.compiler,
|
&tempdir,
|
||||||
&self.cpu_features,
|
&self.compiler,
|
||||||
&cross_compilation.target,
|
&self.cpu_features,
|
||||||
object_format,
|
&cross_compilation.target,
|
||||||
&self.precompiled_atom,
|
object_format,
|
||||||
AllowMultiWasm::Allow,
|
&self.precompiled_atom,
|
||||||
self.debug_dir.is_some(),
|
AllowMultiWasm::Allow,
|
||||||
)?;
|
self.debug_dir.is_some(),
|
||||||
get_module_infos(&tempdir, &atoms, object_format)?;
|
)
|
||||||
let mut entrypoint = get_entrypoint(&tempdir)?;
|
} else {
|
||||||
create_header_files_in_dir(&tempdir, &mut entrypoint, &atoms, &self.precompiled_atom)?;
|
// wasm file
|
||||||
link_exe_from_dir(
|
prepare_directory_from_single_wasm_file(
|
||||||
&tempdir,
|
&input_path,
|
||||||
output_path,
|
&tempdir,
|
||||||
&cross_compilation,
|
&self.compiler,
|
||||||
&self.libraries,
|
&cross_compilation.target,
|
||||||
self.debug_dir.is_some(),
|
&self.cpu_features,
|
||||||
&atoms,
|
object_format,
|
||||||
&self.precompiled_atom,
|
&self.precompiled_atom,
|
||||||
)?;
|
self.debug_dir.is_some(),
|
||||||
} else {
|
)
|
||||||
// wasm file
|
}?;
|
||||||
let atoms = prepare_directory_from_single_wasm_file(
|
|
||||||
&input_path,
|
get_module_infos(&tempdir, &atoms, object_format)?;
|
||||||
&tempdir,
|
let mut entrypoint = get_entrypoint(&tempdir)?;
|
||||||
&self.compiler,
|
create_header_files_in_dir(&tempdir, &mut entrypoint, &atoms, &self.precompiled_atom)?;
|
||||||
&cross_compilation.target,
|
link_exe_from_dir(
|
||||||
&self.cpu_features,
|
&tempdir,
|
||||||
object_format,
|
output_path,
|
||||||
&self.precompiled_atom,
|
&cross_compilation,
|
||||||
self.debug_dir.is_some(),
|
&self.libraries,
|
||||||
)?;
|
self.debug_dir.is_some(),
|
||||||
get_module_infos(&tempdir, &atoms, object_format)?;
|
&atoms,
|
||||||
let mut entrypoint = get_entrypoint(&tempdir)?;
|
&self.precompiled_atom,
|
||||||
create_header_files_in_dir(&tempdir, &mut entrypoint, &atoms, &self.precompiled_atom)?;
|
)?;
|
||||||
link_exe_from_dir(
|
|
||||||
&tempdir,
|
|
||||||
output_path,
|
|
||||||
&cross_compilation,
|
|
||||||
&self.libraries,
|
|
||||||
self.debug_dir.is_some(),
|
|
||||||
&atoms,
|
|
||||||
&self.precompiled_atom,
|
|
||||||
)?;
|
|
||||||
}
|
|
||||||
|
|
||||||
if self.target_triple.is_some() {
|
if self.target_triple.is_some() {
|
||||||
eprintln!(
|
eprintln!(
|
||||||
|
|||||||
Reference in New Issue
Block a user