File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change 1010
1111use autocxx_engine:: { BuilderContext , RebuildDependencyRecorder } ;
1212use indexmap:: set:: IndexSet as HashSet ;
13- use std:: { io:: Write , sync:: Mutex } ;
13+ use std:: {
14+ borrow:: Borrow ,
15+ io:: Write ,
16+ sync:: { LazyLock , Mutex } ,
17+ } ;
1418
1519pub type Builder = autocxx_engine:: Builder < ' static , CargoBuilderContext > ;
1620
1721#[ doc( hidden) ]
1822pub struct CargoBuilderContext ;
1923
24+ static ENV_LOGGER : LazyLock < ( ) > = LazyLock :: new ( || {
25+ env_logger:: builder ( )
26+ . format ( |buf, record| writeln ! ( buf, "cargo:warning=MESSAGE:{}" , record. args( ) ) )
27+ . init ( ) ;
28+ } ) ;
29+
2030impl BuilderContext for CargoBuilderContext {
2131 fn setup ( ) {
22- env_logger:: builder ( )
23- . format ( |buf, record| writeln ! ( buf, "cargo:warning=MESSAGE:{}" , record. args( ) ) )
24- . init ( ) ;
32+ ENV_LOGGER . borrow ( ) ;
2533 }
2634 fn get_dependency_recorder ( ) -> Option < Box < dyn RebuildDependencyRecorder > > {
2735 Some ( Box :: new ( CargoRebuildDependencyRecorder :: new ( ) ) )
You can’t perform that action at this time.
0 commit comments