Skip to content

Commit

Permalink
Fixed building with with just the sys feature (#3659)
Browse files Browse the repository at this point in the history
Fixed building with 'cargo build --no-default-features --features=sys --manifest-path=lib/api/Cargo.toml'
  • Loading branch information
ptitSeb authored Mar 7, 2023
1 parent a232fbf commit 627a726
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/api/src/sys/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ pub(crate) fn default_engine() -> Engine {
}
}
} else {
compile_error!("No default engine chosen")
EngineBuilder::headless().engine()
}
}
}
Expand Down Expand Up @@ -84,6 +84,7 @@ pub trait NativeEngineExt {
}

impl NativeEngineExt for crate::engine::Engine {
#[cfg(feature = "compiler")]
fn new(compiler_config: Box<dyn CompilerConfig>, target: Target, features: Features) -> Self {
Self(Engine::new(compiler_config, target, features))
}
Expand Down
2 changes: 1 addition & 1 deletion lib/api/src/sys/module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ impl Module {
#[cfg(not(feature = "compiler"))]
fn compile(engine: &impl AsEngineRef, binary: &[u8]) -> Result<Self, CompileError> {
Err(CompileError::UnsupportedTarget(
"The compiler feature is not enabled, but is required to compile a Module",
"The compiler feature is not enabled, but is required to compile a Module".to_string(),
))
}

Expand Down

0 comments on commit 627a726

Please sign in to comment.