@@ -117,24 +117,31 @@ public ValueTask ExecuteAsync(IConsole console)
117117 }
118118 }
119119
120- // .def and .lib file paths
121- string defFilePath = Path . Combine ( PlatformOutput . FullName , "Minecraft.Windows.def" ) ;
122- string libFilePath = Path . Combine ( PlatformOutput . FullName , "Minecraft.Windows.lib" ) ;
123-
124- // Create .def file
125- Utils . CreateDefinitionFile ( defFilePath , allMangledNames ) ;
126-
127- // Generate .lib file
128- var libProc = Lib . GenerateLib ( defFilePath , libFilePath ) ;
129- libProc . WaitForExit ( ) ;
130- if ( libProc . ExitCode != 0 )
120+ int index = 0 ;
121+ foreach ( var chunk in allMangledNames . ChunkBy ( 65534 ) )
131122 {
132- return ValueTask . FromException ( new Exception ( "Library generation aborted due to errors." ) ) ;
123+ // .def and .lib file paths
124+ string defFilePath = Path . Combine ( PlatformOutput . FullName , $ "Minecraft.Windows.{ index } .def") ;
125+ string libFilePath = Path . Combine ( PlatformOutput . FullName , $ "Minecraft.Windows.{ index } .lib") ;
126+
127+ // Create .def file
128+ Utils . CreateDefinitionFile ( defFilePath , chunk ) ;
129+
130+ // Generate .lib file
131+ var libProc = Lib . GenerateLib ( defFilePath , libFilePath ) ;
132+ libProc . WaitForExit ( ) ;
133+ if ( libProc . ExitCode != 0 ) {
134+ return ValueTask . FromException ( new Exception ( "Library generation aborted due to errors." ) ) ;
135+ }
136+
137+ Logger . Debug ( $ "Library 'Minecraft.Windows.{ index } .lib' generated succesfully.") ;
138+ File . Delete ( defFilePath ) ; // Clean up .def file
139+ File . Delete ( Path . ChangeExtension ( defFilePath , ".exp" ) ) ; // Clean up .exp file
140+ index ++ ;
133141 }
134142
135143 // Save updated checksums only if all operations succeeded
136144 symbolTracker . SaveChecksums ( checksums ) ;
137- Logger . Debug ( "Library 'Minecraft.Windows.lib' generated succesfully." ) ;
138145 return default ;
139146 }
140147 }
0 commit comments