File tree Expand file tree Collapse file tree 2 files changed +45
-0
lines changed Expand file tree Collapse file tree 2 files changed +45
-0
lines changed Original file line number Diff line number Diff line change 11fn main ( ) {
22 vergen:: EmitBuilder :: builder ( ) . git_sha ( true ) . emit ( ) . unwrap ( ) ;
3+
4+ // Define features to check and display
5+ let features_to_check = vec ! [ "cuda" , "tco" ] ;
6+
7+ // Check which of these features are enabled
8+ let mut enabled_features = Vec :: new ( ) ;
9+ for feature in features_to_check {
10+ let env_var = format ! ( "CARGO_FEATURE_{}" , feature. to_uppercase( ) . replace( '-' , "_" ) ) ;
11+ if std:: env:: var ( & env_var) . is_ok ( ) {
12+ enabled_features. push ( feature) ;
13+ }
14+ }
15+
16+ if !enabled_features. is_empty ( ) {
17+ let features_str = enabled_features. join ( ", " ) ;
18+ println ! ( "Building cargo-openvm with features: {features_str}" ) ;
19+ }
320}
Original file line number Diff line number Diff line change @@ -11,6 +11,34 @@ use std::process::{Command, Stdio};
1111use eyre:: { Context , Result } ;
1212pub use openvm_build:: { get_rustup_toolchain_name, DEFAULT_RUSTUP_TOOLCHAIN_NAME } ;
1313
14+ #[ cfg( all( feature = "cuda" , feature = "tco" ) ) ]
15+ pub const OPENVM_VERSION_MESSAGE : & str = concat ! (
16+ "v" ,
17+ env!( "CARGO_PKG_VERSION" ) ,
18+ " (" ,
19+ env!( "VERGEN_GIT_SHA" ) ,
20+ ") [cuda, tco]"
21+ ) ;
22+
23+ #[ cfg( all( feature = "cuda" , not( feature = "tco" ) ) ) ]
24+ pub const OPENVM_VERSION_MESSAGE : & str = concat ! (
25+ "v" ,
26+ env!( "CARGO_PKG_VERSION" ) ,
27+ " (" ,
28+ env!( "VERGEN_GIT_SHA" ) ,
29+ ") [cuda]"
30+ ) ;
31+
32+ #[ cfg( all( not( feature = "cuda" ) , feature = "tco" ) ) ]
33+ pub const OPENVM_VERSION_MESSAGE : & str = concat ! (
34+ "v" ,
35+ env!( "CARGO_PKG_VERSION" ) ,
36+ " (" ,
37+ env!( "VERGEN_GIT_SHA" ) ,
38+ ") [tco]"
39+ ) ;
40+
41+ #[ cfg( all( not( feature = "cuda" ) , not( feature = "tco" ) ) ) ]
1442pub const OPENVM_VERSION_MESSAGE : & str = concat ! (
1543 "v" ,
1644 env!( "CARGO_PKG_VERSION" ) ,
You can’t perform that action at this time.
0 commit comments