rename feature

This commit is contained in:
vms 2020-08-23 03:18:24 +03:00
parent 03042d4568
commit 73b34b7e63
7 changed files with 8 additions and 11 deletions

View File

@ -21,4 +21,4 @@ fluence-sdk-wit = { path = "../wit", version = "=0.2.0" }
[features]
# Indicates that this crate is included to the Fluence Rust sdk (it affects internal path adjusting)
fce = ["fluence-sdk-wit/fce"]
used_in_sdk = ["fluence-sdk-wit/used_in_sdk"]

View File

@ -19,7 +19,7 @@ crate-type = ["rlib"]
[dependencies]
log = { version = "0.4.8", features = ["std"] }
fluence-sdk-macro = { path = "../macro", features = ["fce"] }
fluence-sdk-macro = { path = "../macro", features = ["used_in_sdk"] }
serde = "1.0.115"
[dev-dependencies]
@ -32,6 +32,3 @@ debug = []
# Enable logger (this will cause log_utf8_string to appear in imports)
logger = []
# Indicates that this crate is included to the Fluence Rust sdk (it affects internal path adjusting)
fce = ["fluence-sdk-macro/fce"]

View File

@ -37,7 +37,7 @@ impl CallParameters {
}
}
#[cfg(not(feature = "fce"))]
#[cfg(not(feature = "used_in_sdk"))]
#[fce]
#[link(wasm_import_module = "host")]
#[allow(improper_ctypes)]

View File

@ -38,7 +38,7 @@ mod logger;
mod result;
pub use call_parameters::CallParameters;
#[cfg(not(feature = "fce"))]
#[cfg(not(feature = "used_in_sdk"))]
pub use call_parameters::get_call_parameters;
pub use export_allocator::allocate;
pub use export_allocator::deallocate;

View File

@ -23,4 +23,4 @@ uuid = { version = "0.8.1", features = ["v4"] }
[features]
# Indicates that this crate is included to the Fluence Rust sdk (it affects internal path adjusting)
fce = []
used_in_sdk = []

View File

@ -73,12 +73,12 @@ impl ForeignModEpilogGlueCodeGenerator for Option<ParsedType> {
}
}
#[cfg(not(feature = "fce"))]
#[cfg(not(feature = "used_in_sdk"))]
fn get_crate_path() -> proc_macro2::TokenStream {
quote! { fluence::internal }
}
#[cfg(feature = "fce")]
#[cfg(feature = "used_in_sdk")]
fn get_crate_path() -> proc_macro2::TokenStream {
quote! { crate }
}

View File

@ -43,7 +43,7 @@ impl quote::ToTokens for fce_ast_types::AstRecordItem {
let glue_code = quote::quote! {
#original
#[cfg(any(target_arch = "wasm32", feature = "fce"))]
#[cfg(any(target_arch = "wasm32", feature = "used_in_sdk"))]
#[doc(hidden)]
#[allow(clippy::all)]
impl #record_name {