spl: Feature gate modules and only enable token, mint, and associated token by default (#973)

This commit is contained in:
Paul 2021-11-06 13:49:06 +00:00 committed by GitHub
parent 2758e8d6c4
commit 54f24e5596
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 5 deletions

View File

@ -7,12 +7,17 @@ license = "Apache-2.0"
description = "CPI clients for SPL programs"
[features]
default = ["mint", "token", "associated_token"]
mint = []
token = []
associated_token = []
governance = []
shmem = []
devnet = []
[dependencies]
anchor-lang = { path = "../lang", version = "0.18.0", features = ["derive"] }
lazy_static = "1.4.0"
serum_dex = { git = "https://github.com/project-serum/serum-dex", rev = "1be91f2", version = "0.4.0", features = ["no-entrypoint"] }
serum_dex = { git = "https://github.com/project-serum/serum-dex", rev = "1be91f2", version = "0.4.0", features = ["no-entrypoint"], optional = true}
solana-program = "1.8.0"
spl-token = { version = "3.1.1", features = ["no-entrypoint"] }
spl-associated-token-account = { version = "1.0.3", features = ["no-entrypoint"] }

View File

@ -1,6 +1,17 @@
#[cfg(feature = "associated_token")]
pub mod associated_token;
pub mod dex;
pub mod governance;
#[cfg(feature = "mint")]
pub mod mint;
pub mod shmem;
#[cfg(feature = "token")]
pub mod token;
#[cfg(feature = "serum_dex")]
pub mod dex;
#[cfg(feature = "governance")]
pub mod governance;
#[cfg(feature = "shmem")]
pub mod shmem;