Skip to content

Commit d258b27

Browse files
committed
additional-libs instead of opt
1 parent 11228ff commit d258b27

3 files changed

Lines changed: 6 additions & 11 deletions

File tree

cmd/soroban-cli/src/commands/contract/build.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -236,13 +236,13 @@ impl Cmd {
236236
target_file_path.clone()
237237
};
238238

239-
#[cfg(feature = "opt")]
239+
#[cfg(feature = "additional-libs")]
240240
let mut optimized_path = None;
241-
#[cfg(not(feature = "opt"))]
241+
#[cfg(not(feature = "additional-libs"))]
242242
let optimized_path = None;
243243

244244
if self.optimize {
245-
#[cfg(feature = "opt")]
245+
#[cfg(feature = "additional-libs")]
246246
{
247247
use crate::wasm::Args as WasmArgs;
248248
let optimized_file_path = final_path.with_extension("optimized.wasm");
@@ -252,7 +252,7 @@ impl Cmd {
252252
wasm_args.optimize(&optimized_file_path)?;
253253
optimized_path = Some(optimized_file_path);
254254
}
255-
#[cfg(not(feature = "opt"))]
255+
#[cfg(not(feature = "additional-libs"))]
256256
{
257257
print.warnln(
258258
"Must install with \"opt\" feature (e.g. `cargo install --locked soroban-cli --features opt`) to use --optimize",

cmd/soroban-cli/src/commands/contract/optimize.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
use clap::{arg, command, Parser};
22
use std::fmt::Debug;
3-
#[cfg(feature = "additional-libs")]
4-
use wasm_opt::{Feature, OptimizationError, OptimizationOptions};
53

64
use crate::wasm;
75

@@ -19,9 +17,6 @@ pub struct Cmd {
1917
pub enum Error {
2018
#[error(transparent)]
2119
Wasm(#[from] wasm::Error),
22-
#[cfg(feature = "additional-libs")]
23-
#[error("optimization error: {0}")]
24-
OptimizationError(OptimizationError),
2520
#[cfg(not(feature = "additional-libs"))]
2621
#[error("must install with \"additional-libs\" feature.")]
2722
Install,

cmd/soroban-cli/src/wasm.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ pub enum Error {
5050
ContractIsStellarAsset,
5151
#[error(transparent)]
5252
Network(#[from] NetworkError),
53-
#[cfg(feature = "opt")]
53+
#[cfg(feature = "additional-libs")]
5454
#[error("optimization error: {0}")]
5555
OptimizationError(#[from] wasm_opt::OptimizationError),
5656
}
@@ -96,7 +96,7 @@ impl Args {
9696
Ok(Hash(Sha256::digest(self.read()?).into()))
9797
}
9898

99-
#[cfg(feature = "opt")]
99+
#[cfg(feature = "additional-libs")]
100100
/// Optimizes the wasm file in place or outputs to another file.
101101
pub fn optimize(&self, output: &Path) -> Result<(), Error> {
102102
use wasm_opt::{Feature, OptimizationOptions};

0 commit comments

Comments
 (0)