File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -416,7 +416,7 @@ impl WorkspaceBuildScripts {
416416 let path = dir_entry. path ( ) ;
417417 tracing:: info!( "p{:?}" , path) ;
418418 let extension = path. extension ( ) ?;
419- if extension == "dll" || extension == "so" {
419+ if extension == std :: env :: consts :: DLL_EXTENSION {
420420 let name = path. file_stem ( ) ?. to_str ( ) ?. split_once ( '-' ) ?. 0 . to_owned ( ) ;
421421 let path = AbsPathBuf :: try_from ( path) . ok ( ) ?;
422422 return Some ( ( name, path) ) ;
@@ -426,10 +426,13 @@ impl WorkspaceBuildScripts {
426426 } )
427427 . collect ( ) ;
428428 for p in rustc. packages ( ) {
429- if let Some ( ( _, path) ) =
430- proc_macro_dylibs. iter ( ) . find ( |( name, _) | * name == rustc[ p] . name )
431- {
432- bs. outputs [ p] . proc_macro_dylib_path = Some ( path. clone ( ) ) ;
429+ let package = & rustc[ p] ;
430+ if package. targets . iter ( ) . any ( |& it| rustc[ it] . is_proc_macro ) {
431+ if let Some ( ( _, path) ) =
432+ proc_macro_dylibs. iter ( ) . find ( |( name, _) | * name == package. name )
433+ {
434+ bs. outputs [ p] . proc_macro_dylib_path = Some ( path. clone ( ) ) ;
435+ }
433436 }
434437 }
435438
You can’t perform that action at this time.
0 commit comments