Skip to content

Commit dd8f0c0

Browse files
committed
Gate AbstractType derive macro behind a derive feature-flag
1 parent 8ef8ab4 commit dd8f0c0

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

rust/Cargo.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,17 @@ edition = "2021"
66

77
[features]
88
noexports = []
9+
derive = ["binaryninja-derive", "elain"]
910

1011
[dependencies]
1112
lazy_static = "1.4.0"
1213
log = "0.4"
1314
libc = "0.2"
1415
rayon = { version = "1.8", optional = true }
1516
binaryninjacore-sys = { path = "binaryninjacore-sys" }
16-
binaryninja-derive = { path = "binaryninja-derive" }
17-
elain = "0.3.0"
17+
binaryninja-derive = { path = "binaryninja-derive", optional = true }
18+
# Const-generic alignment gadgetry used by the `AbstractType` derive macro
19+
elain = { version = "0.3.0", optional = true }
1820

1921
[workspace]
2022
members = [

rust/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ use std::path::PathBuf;
171171
pub use binaryninjacore_sys::BNBranchType as BranchType;
172172
pub use binaryninjacore_sys::BNEndianness as Endianness;
173173
use binaryview::BinaryView;
174+
#[cfg(feature = "derive")]
174175
pub use elain;
175176
use metadata::Metadata;
176177
use metadata::MetadataType;

rust/src/types.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -698,6 +698,7 @@ impl Drop for TypeBuilder {
698698
//////////
699699
// Type
700700

701+
#[cfg(feature = "derive")]
701702
pub use binaryninja_derive::*;
702703
pub trait AbstractType: Sized {
703704
const SIZE: usize = std::mem::size_of::<Self>();

0 commit comments

Comments
 (0)