From f4276738600bb35604e605e87ed06f1f77f73c69 Mon Sep 17 00:00:00 2001 From: Tristan Labelle Date: Sat, 5 Oct 2024 08:43:48 -0400 Subject: [PATCH 1/2] Increase the -driver-filelist-threshold workaround --- Generator/Sources/SwiftWinRT/writeProjectionFiles.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Generator/Sources/SwiftWinRT/writeProjectionFiles.swift b/Generator/Sources/SwiftWinRT/writeProjectionFiles.swift index a1307d3..8599dd8 100644 --- a/Generator/Sources/SwiftWinRT/writeProjectionFiles.swift +++ b/Generator/Sources/SwiftWinRT/writeProjectionFiles.swift @@ -111,9 +111,11 @@ fileprivate func writeSwiftModuleFiles(_ module: Module, directoryPath: String, } // Workaround for https://github.com/swiftlang/swift-driver/issues/1477 + // The threshold value has to be real high because the driver multiplies the number of input files by ~50. + // See https://github.com/swiftlang/swift-driver/blob/6af4c7dbc0559694578e5221d49970f94603b9e5/Sources/SwiftDriver/Jobs/FrontendJobHelpers.swift#L714 writer.writeSingleLineCommand( "target_compile_options", .autoquote(targetName), - "PRIVATE", "-driver-filelist-threshold=9999") + "PRIVATE", "-driver-filelist-threshold=\(Int32.max)") writer.writeTargetLinkLibraries(targetName, .public, [ cmakeOptions.getTargetName(moduleName: module.abiModuleName), SupportModules.WinRT.moduleName ] From f7ea213e9cd1dc10b7f1f5cad385a7588b70a803 Mon Sep 17 00:00:00 2001 From: Tristan Labelle Date: Sat, 5 Oct 2024 08:49:23 -0400 Subject: [PATCH 2/2] Missing .unquoted --- Generator/Sources/SwiftWinRT/writeProjectionFiles.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Generator/Sources/SwiftWinRT/writeProjectionFiles.swift b/Generator/Sources/SwiftWinRT/writeProjectionFiles.swift index 8599dd8..bc0f908 100644 --- a/Generator/Sources/SwiftWinRT/writeProjectionFiles.swift +++ b/Generator/Sources/SwiftWinRT/writeProjectionFiles.swift @@ -115,7 +115,7 @@ fileprivate func writeSwiftModuleFiles(_ module: Module, directoryPath: String, // See https://github.com/swiftlang/swift-driver/blob/6af4c7dbc0559694578e5221d49970f94603b9e5/Sources/SwiftDriver/Jobs/FrontendJobHelpers.swift#L714 writer.writeSingleLineCommand( "target_compile_options", .autoquote(targetName), - "PRIVATE", "-driver-filelist-threshold=\(Int32.max)") + "PRIVATE", .unquoted("-driver-filelist-threshold=\(Int32.max)")) writer.writeTargetLinkLibraries(targetName, .public, [ cmakeOptions.getTargetName(moduleName: module.abiModuleName), SupportModules.WinRT.moduleName ]