@@ -293,6 +293,50 @@ public struct BuildParameters: Encodable {
293
293
self . verboseOutput = verboseOutput
294
294
}
295
295
296
+ public func withDestination( _ destinationTriple: Triple ) throws -> BuildParameters {
297
+ let forceTestDiscovery : Bool
298
+ let testEntryPointPath : AbsolutePath ?
299
+ switch self . testProductStyle {
300
+ case . entryPointExecutable( let explicitlyEnabledDiscovery, let explicitlySpecifiedPath) :
301
+ forceTestDiscovery = explicitlyEnabledDiscovery
302
+ testEntryPointPath = explicitlySpecifiedPath
303
+ case . loadableBundle:
304
+ forceTestDiscovery = false
305
+ testEntryPointPath = nil
306
+ }
307
+
308
+ return . init(
309
+ dataPath: self . dataPath. parentDirectory. appending ( components: [ " plugins " , " tools " ] ) ,
310
+ configuration: self . configuration,
311
+ toolchain: try UserToolchain ( destination: Destination . hostDestination ( ) ) ,
312
+ hostTriple: self . hostTriple,
313
+ destinationTriple: destinationTriple,
314
+ flags: BuildFlags ( ) ,
315
+ pkgConfigDirectories: self . pkgConfigDirectories,
316
+ architectures: nil ,
317
+ workers: self . workers,
318
+ shouldLinkStaticSwiftStdlib: self . shouldLinkStaticSwiftStdlib,
319
+ shouldEnableManifestCaching: self . shouldEnableManifestCaching,
320
+ canRenameEntrypointFunctionName: self . canRenameEntrypointFunctionName,
321
+ shouldCreateDylibForDynamicProducts: self . shouldCreateDylibForDynamicProducts,
322
+ sanitizers: self . sanitizers,
323
+ enableCodeCoverage: self . enableCodeCoverage,
324
+ indexStoreMode: self . indexStoreMode,
325
+ enableParseableModuleInterfaces: self . enableParseableModuleInterfaces,
326
+ emitSwiftModuleSeparately: self . emitSwiftModuleSeparately,
327
+ useIntegratedSwiftDriver: self . useIntegratedSwiftDriver,
328
+ useExplicitModuleBuild: self . useExplicitModuleBuild,
329
+ isXcodeBuildSystemEnabled: self . isXcodeBuildSystemEnabled,
330
+ enableTestability: self . enableTestability,
331
+ forceTestDiscovery: forceTestDiscovery,
332
+ testEntryPointPath: testEntryPointPath,
333
+ explicitTargetDependencyImportCheckingMode: self . explicitTargetDependencyImportCheckingMode,
334
+ linkerDeadStrip: self . linkerDeadStrip,
335
+ colorizedOutput: self . colorizedOutput,
336
+ verboseOutput: self . verboseOutput
337
+ )
338
+ }
339
+
296
340
/// The path to the build directory (inside the data directory).
297
341
public var buildPath : AbsolutePath {
298
342
if isXcodeBuildSystemEnabled {
0 commit comments