11use crate :: trident_svm:: TridentSVM ;
22use crate :: trident_svm_log:: { setup_cli_logging, setup_file_logging, turn_off_solana_logging} ;
33use crate :: types:: trident_account:: TridentAccountSharedData ;
4+ #[ cfg( any( feature = "syscall-v1" , feature = "syscall-v2" ) ) ]
45use crate :: types:: trident_entrypoint:: TridentEntrypoint ;
56use crate :: types:: trident_program:: TridentProgram ;
67
@@ -10,6 +11,7 @@ pub struct TridentSVMConfig {
1011 syscalls_v2 : bool ,
1112 cli_logs : bool , // TODO, add better debbug levels
1213 debug_file_logs : bool ,
14+ #[ cfg( any( feature = "syscall-v1" , feature = "syscall-v2" ) ) ]
1315 program_entrypoints : Vec < TridentEntrypoint > ,
1416 program_binaries : Vec < TridentProgram > ,
1517 permanent_accounts : Vec < TridentAccountSharedData > ,
@@ -37,6 +39,7 @@ impl TridentSVMBuilder {
3739 self
3840 }
3941
42+ #[ cfg( any( feature = "syscall-v1" , feature = "syscall-v2" ) ) ]
4043 pub fn with_program_entries ( & mut self , entries : Vec < TridentEntrypoint > ) -> & Self {
4144 self . config . program_entrypoints = entries;
4245 self
@@ -65,9 +68,11 @@ impl TridentSVMBuilder {
6568 pub fn build ( & self ) -> TridentSVM {
6669 let mut svm = TridentSVM :: default ( ) ;
6770
71+ #[ cfg( feature = "syscall-v1" ) ]
6872 if self . config . syscalls_v1 {
6973 svm. initialize_syscalls_v1 ( ) ;
7074 }
75+ #[ cfg( feature = "syscall-v2" ) ]
7176 if self . config . syscalls_v2 {
7277 svm. initialize_syscalls_v2 ( ) ;
7378 }
@@ -80,6 +85,7 @@ impl TridentSVMBuilder {
8085 turn_off_solana_logging ( ) ;
8186 }
8287
88+ #[ cfg( any( feature = "syscall-v1" , feature = "syscall-v2" ) ) ]
8389 for entry in & self . config . program_entrypoints {
8490 svm. deploy_entrypoint_program ( entry) ;
8591 }
0 commit comments